1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-26 17:08:07 +00:00

autoSelect props in Input component

This commit is contained in:
Szymon Lesisz 2018-11-22 15:01:45 +01:00
parent 556b2be84f
commit d26d354fbd
2 changed files with 4 additions and 0 deletions

View File

@ -185,6 +185,7 @@ class Input extends PureComponent {
value={this.props.value}
readOnly={this.props.readOnly}
onChange={this.props.onChange}
onClick={this.props.autoSelect ? event => event.target.select() : null}
borderColor={this.getColor(this.props.state)}
disabled={this.props.isDisabled}
name={this.props.name}
@ -220,6 +221,7 @@ Input.propTypes = {
spellCheck: PropTypes.string,
value: PropTypes.string,
readOnly: PropTypes.bool,
autoSelect: PropTypes.bool,
onChange: PropTypes.func,
state: PropTypes.string,
bottomText: PropTypes.string,
@ -233,6 +235,7 @@ Input.propTypes = {
Input.defaultProps = {
type: 'text',
autoSelect: false,
};
export default Input;

View File

@ -121,6 +121,7 @@ const AccountReceive = (props: Props) => {
<Input
type="text"
readOnly
autoSelect
value={address}
isPartiallyHidden={isAddressHidden}
trezorAction={isAddressVerifying ? (