forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#7126 from parasharrajat/double-keyboard
Block Virtual keyboard on Request Money Page
- Loading branch information
Showing
5 changed files
with
116 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...nents/TextInputAutoWidthWithoutKeyboard/baseTextInputAutoWidthWithoutKeyboardPropTypes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
const propTypes = { | ||
/** The value of the comment box */ | ||
value: PropTypes.string.isRequired, | ||
|
||
/** A ref to forward to the text input */ | ||
forwardedRef: PropTypes.func.isRequired, | ||
|
||
/** General styles to apply to the text input */ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
inputStyle: PropTypes.object, | ||
|
||
/** Styles to apply to the text input */ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
textStyle: PropTypes.object.isRequired, | ||
|
||
/** Optional placeholder to show when there is no value */ | ||
placeholder: PropTypes.string, | ||
}; | ||
|
||
const defaultProps = { | ||
inputStyle: {}, | ||
placeholder: '', | ||
}; | ||
|
||
export {propTypes, defaultProps}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import BaseTextInputAutoWidthWithoutKeyboard from './BaseTextInputAutoWidthWithoutKeyboard'; | ||
import * as baseTextInputAutoWidthWithoutKeyboardPropTypes from './baseTextInputAutoWidthWithoutKeyboardPropTypes'; | ||
|
||
class TextInputAutoWidthWithoutKeyboard extends React.Component { | ||
componentDidMount() { | ||
this.textInput.setNativeProps({inputmode: 'none'}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<BaseTextInputAutoWidthWithoutKeyboard | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...this.props} | ||
ref={(el) => { | ||
this.textInput = el; | ||
this.props.forwardedRef(el); | ||
}} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
TextInputAutoWidthWithoutKeyboard.propTypes = baseTextInputAutoWidthWithoutKeyboardPropTypes.propTypes; | ||
TextInputAutoWidthWithoutKeyboard.defaultProps = baseTextInputAutoWidthWithoutKeyboardPropTypes.defaultProps; | ||
|
||
export default React.forwardRef((props, ref) => ( | ||
/* eslint-disable-next-line react/jsx-props-no-spreading */ | ||
<TextInputAutoWidthWithoutKeyboard {...props} forwardedRef={ref} /> | ||
)); |
20 changes: 20 additions & 0 deletions
20
src/components/TextInputAutoWidthWithoutKeyboard/index.native.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import BaseTextInputAutoWidthWithoutKeyboard from './BaseTextInputAutoWidthWithoutKeyboard'; | ||
import * as baseTextInputAutoWidthWithoutKeyboardPropTypes from './baseTextInputAutoWidthWithoutKeyboardPropTypes'; | ||
|
||
const TextInputAutoWidthWithoutKeyboard = props => ( | ||
<BaseTextInputAutoWidthWithoutKeyboard | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
ref={props.forwardedRef} | ||
/> | ||
); | ||
|
||
TextInputAutoWidthWithoutKeyboard.propTypes = baseTextInputAutoWidthWithoutKeyboardPropTypes.propTypes; | ||
TextInputAutoWidthWithoutKeyboard.defaultProps = baseTextInputAutoWidthWithoutKeyboardPropTypes.defaultProps; | ||
TextInputAutoWidthWithoutKeyboard.displayName = 'TextInputAutoWidthWithoutKeyboard'; | ||
|
||
export default React.forwardRef((props, ref) => ( | ||
/* eslint-disable-next-line react/jsx-props-no-spreading */ | ||
<TextInputAutoWidthWithoutKeyboard {...props} forwardedRef={ref} /> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters