Skip to content

Commit

Permalink
Make children clickable when parent is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-dickinson committed Jun 13, 2023
1 parent 2a901e5 commit e4177c8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ exports[`components/Pressable prop "accessibilityRole" value is set 1`] = `
exports[`components/Pressable prop "disabled" 1`] = `
<div
aria-disabled="true"
class="css-view-175oi2r r-pointerEvents-633pao"
class="css-view-175oi2r r-pointerEvents-12vffkv"
tabindex="-1"
/>
`;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-web/src/exports/Pressable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const styles = StyleSheet.create({
touchAction: 'manipulation'
},
disabled: {
pointerEvents: 'none'
pointerEvents: 'box-none'
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function TouchableHighlight(props: Props, forwardedRef): React.Node {
{...pressEventHandlers}
accessibilityDisabled={disabled}
focusable={!disabled && focusable !== false}
pointerEvents={disabled ? 'none' : undefined}
pointerEvents={disabled ? 'box-none' : undefined}
ref={setRef}
style={[
styles.root,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function TouchableOpacity(props: Props, forwardedRef): React.Node {
{...pressEventHandlers}
accessibilityDisabled={disabled}
focusable={!disabled && focusable !== false}
pointerEvents={disabled ? 'none' : undefined}
pointerEvents={disabled ? 'box-none' : undefined}
ref={setRef}
style={[
styles.root,
Expand Down

0 comments on commit e4177c8

Please sign in to comment.