Skip to content

Commit

Permalink
Mark TouchableRipple disabled if not editable or tappable (#31052)
Browse files Browse the repository at this point in the history
  • Loading branch information
hypest authored Apr 22, 2021
1 parent c3709a3 commit a4782af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/components/src/mobile/bottom-sheet/cell.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ class BottomSheetCell extends Component {
cellRowContainerStyle,
];

const isInteractive =
isValueEditable ||
onPress !== undefined ||
onLongPress !== undefined;

const onCellPress = () => {
if ( isValueEditable ) {
startEditing();
Expand Down Expand Up @@ -308,7 +313,7 @@ class BottomSheetCell extends Component {
__( 'Double tap to edit this value' )
: accessibilityHint
}
disabled={ disabled }
disabled={ disabled || ! isInteractive }
activeOpacity={ opacity }
onPress={ onCellPress }
onLongPress={ onLongPress }
Expand Down

0 comments on commit a4782af

Please sign in to comment.