Skip to content

Commit

Permalink
Expensify#6547 disable selection on button long press
Browse files Browse the repository at this point in the history
  • Loading branch information
dklymenk committed Dec 8, 2021
1 parent f995a22 commit 4489d4e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ExpensifyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ExpensifyText from './ExpensifyText';
import KeyboardShortcut from '../libs/KeyboardShortcut';
import Icon from './Icon';
import CONST from '../CONST';
import ControlSelection from '../libs/ControlSelection';

const propTypes = {
/** The text for the button label */
Expand Down Expand Up @@ -167,7 +168,11 @@ class ExpensifyButton extends Component {
<Pressable
onPress={this.props.onPress}
onLongPress={this.props.onLongPress}
onPressOut={this.props.onPressOut}
onPressIn={() => ControlSelection.block()}
onPressOut={() => {
this.props.onPressOut();
ControlSelection.unblock();
}}
disabled={this.props.isLoading || this.props.isDisabled}
style={[
this.props.isDisabled ? styles.cursorDisabled : {},
Expand Down

0 comments on commit 4489d4e

Please sign in to comment.