-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inputmode
to a note on type="number"
#5271
Add inputmode
to a note on type="number"
#5271
Conversation
Thanks for this contribution! However, I'm having a hard time understanding the connection between the extensive discussion in your post, and the actual diff here. What I'm getting from your post, is that you want to add a cross-reference to inputmode. So, maybe the patch should just do that? I.e. instead of the other changes to sentence structure, just change "possibly with a pattern attribute" to "possibly with pattern or inputmode attributes". |
@domenic Thanks for your response - sorry if the explanation wasn’t clear. Yes, you’re right, we’re essentially adding a cross-reference to
|
I don't really agrees with your interpretation of how the word "possibly" is being used, or your characterization of pattern as a workaround. Pattern is a useful way to constrain the contents in cases like this. And both pattern and inputmode are not always appropriate, so "possibly" makes sense; it has nothing to do with cross-browser support. I think it would be best to retain the original sentence structure and just insert the inputmode reference. |
Our thinking on this is possibly too focused on bringing up the correct keypad. We can see how However, it seems that Perhaps we could go with your suggestion to retain the original sentence structure but insert
|
@domenic Do you have any thoughts on the above? |
I think my earlier thoughts still stand. I haven't had time to work through the cases you asked about in your second paragraph, but I think the easiest route to resolution remains to retain the original sentence structure and just insert the inputmode reference. We could open a follow-up issue to discuss further tweaks if you really feel strongly. |
c7913fc
to
7634740
Compare
7634740
to
64609ea
Compare
@domenic In order to move this forward I've changed the wording to the one you suggested. I will raise a separate issue to improve the guidance further. Please let me know if there's anything else that needs to be done before this PR can be accepted. |
Improve the guidance by mentioning `inputmode` (alongside `pattern`) as it now has good cross browser support for showing the numeric keypad on mobile. A follow up issue will be raised to improve the wording to make a clearer recommendation to use `inputmode`. Include names of contributors under Acknowledgements. Co-authored-by: Hanna Laakso <[email protected]> Co-authored-by: Mark Green <[email protected]>
64609ea
to
57dff34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This adds
inputmode
to a note ontype=”number”
. It also makes a stronger recommendation to useinputmode
andpattern
whentype=”number”
is not appropriate.What problem does this solve?
The current guidance advises to use
type=”text”
withpattern
whentype=”number”
is not appropriate. However, this solution does not bring up the numeric keypad on mobile devices, apart from iOS where the number keypad is shown withpattern="[0-9]*"
.We can improve the guidance by including
inputmode
which has good cross browser support for showing the numeric keypad on mobile, including more recent versions of iOS.Making the guidance more clearly worded (removing “probably” and “possibly”) makes this recommendation to use
inputmode
andpattern
clearer.Further detail
inputmode
is the semantically correct way of setting the input mode whentype="number"
is not appropriate.pattern
is useful for iOS backwards compatibility for showing the number keypad on mobile.There are various problems with using
type=”number”
when it’s not appropriate. Our team (the GOV.UK Design System team) have investigated this: alphagov/govuk-frontend#1704.Government Digital Service (GDS) has signed the Participation Agreement.
/acknowledgements.html ( diff )
/input.html ( diff )