Skip to content

Commit

Permalink
Merge pull request #156 from SidMorad/inputMode
Browse files Browse the repository at this point in the history
inputMode prop
  • Loading branch information
arunghosh authored Jul 6, 2020
2 parents 9aeabdf + 4e3693f commit 9bc33da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PinItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PinItem extends Component {
this.onChange = this.onChange.bind(this);
this.onKeyDown = this.onKeyDown.bind(this);
this.onFocus = this.onFocus.bind(this);
this.onBlur = this.onBlur.bind(this);
this.onBlur = this.onBlur.bind(this);
}

onKeyDown(e) {
Expand Down Expand Up @@ -89,7 +89,7 @@ class PinItem extends Component {
render() {
const { focus, value } = this.state;
const { type, inputMode, inputStyle, inputFocusStyle } = this.props;
const inputType = this.props.type === 'numeric' ? 'tel' : (this.props.type || 'text');
const inputType = type === 'numeric' ? 'tel' : (type || 'text');
return (<input
disabled={ this.props.disabled ? "disabled": undefined }
className='pincode-input-text'
Expand All @@ -100,6 +100,7 @@ class PinItem extends Component {
maxLength='1'
autoComplete='off'
type={ this.props.secret ? 'password' : inputType }
inputMode={ inputMode || 'text'}
pattern={ this.props.type === 'numeric' ? '[0-9]*' : '[A-Z0-9]*' }
ref={ n => (this.input = n) }
onFocus={ this.onFocus }
Expand Down

0 comments on commit 9bc33da

Please sign in to comment.