Skip to content

Commit

Permalink
numeric input for android
Browse files Browse the repository at this point in the history
  • Loading branch information
efc committed Feb 21, 2019
1 parent f54064d commit 2c54f7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SubcaucusRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export class SubcaucusRow extends React.Component<Props, State> {
keyfilter="pint"
type="text" // number does not support selection of the whole text on
pattern="\d*"
inputMode="numeric"
value={count ? count : ''}
placeholder={`—`}
onChange={this.handleCount()}
Expand Down
1 change: 1 addition & 0 deletions src/ValueCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export class ValueCard extends React.Component<Props, State> {
keyfilter={isPositiveInteger ? "pint" : ""}
type="text"
pattern={isPositiveInteger ? "\\d*" : undefined}
inputMode={isPositiveInteger ? "numeric" : undefined}
value={isPositiveInteger ? (value === '0' ? '' : value) : value} // show 0 as blank for positive integers
placeholder={this.props.defaultValue}
onChange={this.handleChange()}
Expand Down

0 comments on commit 2c54f7e

Please sign in to comment.