feat(input): add inputmode HTML prop
#1010
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Inputmode can improve the UX on mobile devices.
For example, if an input is numeric but isn't supposed to be incremental then you shouldn't be using the
type='number'input andtype='text'should be used instead (see references below on why type='number' shouldn't always be used for numerical data).Test instructions
Set inputmode on gcdsinput element and look at the virtual keyboard on th mobile device.
References
Why inputmode should be used
https://www.atomica11y.com/accessible-design/input-number/
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/number#using_number_inputs
https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/
inputmode
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inputMode