From a18c28cd3434dd3843cefb5aadf8c8616ab72278 Mon Sep 17 00:00:00 2001 From: aimane-chnaif Date: Sun, 6 Nov 2022 09:24:27 +1000 Subject: [PATCH] fix missing cursor on numpad --- src/components/BigNumberPad.js | 1 + src/components/Button.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/components/BigNumberPad.js b/src/components/BigNumberPad.js index 56dc37d5a440..e28eefbd122d 100644 --- a/src/components/BigNumberPad.js +++ b/src/components/BigNumberPad.js @@ -78,6 +78,7 @@ class BigNumberPad extends React.Component { ControlSelection.unblock(); this.props.longPressHandlerStateChanged(false); }} + onMouseDown={e => e.preventDefault()} /> ); })} diff --git a/src/components/Button.js b/src/components/Button.js index e50d13abcbb0..863fcee43296 100644 --- a/src/components/Button.js +++ b/src/components/Button.js @@ -63,6 +63,9 @@ const propTypes = { /** A function that is called when the button is released */ onPressOut: PropTypes.func, + /** Callback that is called when mousedown is triggered. */ + onMouseDown: PropTypes.func, + /** Call the onPress function when Enter key is pressed */ pressOnEnter: PropTypes.bool, @@ -124,6 +127,7 @@ const defaultProps = { onLongPress: () => {}, onPressIn: () => {}, onPressOut: () => {}, + onMouseDown: undefined, pressOnEnter: false, enterKeyEventListenerPriority: 0, style: [], @@ -249,6 +253,7 @@ class Button extends Component { }} onPressIn={this.props.onPressIn} onPressOut={this.props.onPressOut} + onMouseDown={this.props.onMouseDown} disabled={this.props.isLoading || this.props.isDisabled} style={[ this.props.isDisabled ? {...styles.cursorDisabled, ...styles.noSelect} : {},