-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 support for 'enterkeyhint' attribute (was 'inputmodeaction') #3538
Conversation
@domenic thoughts? |
I assume "iconify" is "icon"? Exposing this capability to web apps makes a lot of sense to me. I haven't looked too much at the details yet besides seeing that there's a table of common actions and that this is a hint. It seems like a nice enhancement with no compat concerns in browsers that don't support it, which is nice. @othermaciej, any thoughts as to whether this would be something interesting for mobile Safari? @travisleithead, any thoughts as to whether this would be something interesting for Windows 10's touch keyboard for Edge? Maybe there's already a UWP API for this and you've just been itching to expose it to PWAs? @bzbarsky, any thoughts for Mozilla on the platforms it runs on? I'll try to dive in to the actual spec PR after giving this a few days to gather implementer interest. |
Is there a high-level explanation of this pproposal or do I need to just read the diff text? |
You'll need to read the spec test. But basically this is moz-actionhint in a spec... See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-mozactionhint (with the enter keyword added) |
The current implementation of this stuff in Gecko is basically Android-only. We pass the string around on all platforms, but Android is the only one that does anything with it. The people who implemented this initially are no longer active, and this is the first time I've heard of this attribute myself, so I can't say much more than what I see through code archeology.... It was added in https://bugzilla.mozilla.org/show_bug.cgi?id=589879 largely because Firefox on Android at the time was using web tech for its own UI (mostly; like Firefox desktop does now) and this was needed for the URL bar UI. There was some spirited debate about this implementation and the fact that it was web-exposed (see https://bugzilla.mozilla.org/show_bug.cgi?id=614488 for example). At this point there is one internal consumer (the "search texbox" widget)... which seems to not be used in the Android UI anywhere. So I think at this point mozactionhint is basically dead code we could remove with no observable effects. What this means in terms of exposing it to the web, I'm not sure. ;) If there's a more specific question, I can try to find people who might be able to answer it. |
I think the more specific question is, would Mozilla be interested in exposing a standardized version of the attribute? Instead of deleting their nonstandard one :) |
That sounds like a question for https://github.com/mozilla/standards-positions. |
The idea of making enter key customizable and the list of options in the proposal seems good. iOS allows native apps to do almost exactly this for clarify in UI. Nonetheless, I don't think it makes much sense to call this content attribute Maybe |
Perhaps just |
I think the nice thing about the name is that |
FWIW I've been writing the chromium code for this today and I have been calling it But I named it exactly as @annevk described. |
That naming logic seems too indirect to be obvious. It's true that |
Personally I'm leaning toward either If we'd called Does anyone have comments on the set of actions? I imagine @dtapuska has done the research on how they line up with various platforms, and platforms can always fall back to a default if not supported, but e.g. did anything get left out? |
Given that this is global, |
As someone encountering this attribute for the first time, I find the names ending with Based on this, I would suggest names along the lines of |
|
Ok I've renamed it inputactionlabel is that better? Being that it appears on the HTMLElement I think it needs "input" in the prefix. |
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.
Overall this looks good, but I found a couple of issues.
source
Outdated
contenteditable</code>).</p> | ||
|
||
<p>The <dfn><code data-x="attr-inputactionlabel">inputactionlabel</code></dfn> content attribute is an | ||
<span>enumerated attribute</span> that specifies what kind of iconify for the enter key on |
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.
s/iconify/icon/?
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.
Or maybe use "action label" throughout?
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.
done
source
Outdated
|
||
<p>User agents can support the <code data-x="attr-inputactionlabel">inputactionlabel</code> attribute | ||
on form controls (such as the value of <code>textarea</code> elements), or in elements in an | ||
<span>editing host</span> (e.g., using <code data-x="attr-contenteditable"> |
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.
You cannot break after a tag, that'll add whitespace to its contents.
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.
done
source
Outdated
|
||
<p>When <code data-x="attr-inputactionlabel">inputactionlabel</code> is unspecified (or is in a state not | ||
supported by the user agent), the user agent should determine the default action type to be | ||
shown. Contextual information such as the <code data-x="attr-inputmode">inputmode</code>, input |
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.
I'd drop input here since it's not part of the attribute name.
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.
done
source
Outdated
<p>When <code data-x="attr-inputactionlabel">inputactionlabel</code> is unspecified (or is in a state not | ||
supported by the user agent), the user agent should determine the default action type to be | ||
shown. Contextual information such as the <code data-x="attr-inputmode">inputmode</code>, input | ||
<code data-x="attr-input-type">type</code> or <code data-x="attr-input-pattern">pattern</code> attributes |
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.
Oxford commas please.
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.
done
source
Outdated
<tbody> | ||
<tr> | ||
<td><dfn><code data-x="attr-inputactionlabel-keyword-enter">enter</code></dfn> | ||
<td>The user agent should display a visual queue of the operation 'enter'. |
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.
Do you mean "visual cue"? Why visual though? Presumably assistive technology can also use this?
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.
Ugh yes. it should be cue. I've removed visual and display and used the verb present.
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.
LGTM with my own nits applied (please double check), but needs tests and implementation bugs before merging.
Thanks for pushing this forward!
@rniwa / @othermaciej, are you happy with the name |
I understand the desire to use If it came down to it I don't think we'd hold off on implementing based on the name alone. It doesn't seem like the most important aspect of this feature. But I thought I'd share my view nonetheless. |
Added previous keyboard somehow it never made it in
LGTM! Ready to merge once we have some tests to link to. As with inputmode I anticipate the tests will be pretty basic, just testing the reflection I guess. |
Unless I missed something we'll also need implementation bugs. |
Are these good enough? https://bugzilla.mozilla.org/show_bug.cgi?id=1490661 |
Will need WebKit and Edge too. See https://github.com/whatwg/meta/blob/master/MAINTAINERS.md#handling-pull-requests . (We should probably move that to CONTRIBUTING.md, not just MAINTAINERS.md...) |
Web platform tests are included in Chrome's implementation CL here: https://chromium-review.googlesource.com/c/chromium/src/+/1221696 |
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d
Does it make sense? Nowadays smartphones have virtual keyboards with just "↵" symbol on enter key instead text value. |
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1221696 Commit-Queue: Dave Tapuska <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Changwan Ryu <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Reviewed-by: Joshua Bell <[email protected]> Cr-Commit-Position: refs/heads/master@{#661904}
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1221696 Commit-Queue: Dave Tapuska <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Changwan Ryu <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Reviewed-by: Joshua Bell <[email protected]> Cr-Commit-Position: refs/heads/master@{#661904}
…t., a=testonly Automatic update from web-platform-tests Add experimental support for enterKeyHint. enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1221696 Commit-Queue: Dave Tapuska <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Changwan Ryu <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Reviewed-by: Joshua Bell <[email protected]> Cr-Commit-Position: refs/heads/master@{#661904} -- wp5At-commits: 74870bb3fbf231c8b89f529fbfea7f22ad149c33 wpt-pr: 16718
…t., a=testonly Automatic update from web-platform-tests Add experimental support for enterKeyHint. enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1221696 Commit-Queue: Dave Tapuska <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Changwan Ryu <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Reviewed-by: Joshua Bell <[email protected]> Cr-Commit-Position: refs/heads/master@{#661904} -- wp5At-commits: 74870bb3fbf231c8b89f529fbfea7f22ad149c33 wpt-pr: 16718
heads-up @whatwg/documentation
|
MDN documentation need recorded at https://trello.com/c/aBs1o6Pg/86-dom-general-enhancements-fx-68 |
enterKeyHint allows customization of the virtual keyboard enter key. Enabled behind a flag since it isn't approved to ship yet. Spec: whatwg/html#3538 BUG=634330 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I32b510d8157e0c676300a38bb4c7fa2bbced0b3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1221696 Commit-Queue: Dave Tapuska <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Changwan Ryu <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Reviewed-by: Joshua Bell <[email protected]> Cr-Commit-Position: refs/heads/master@{#661904}
Support in WebKit landed in r251720. |
inputmodeactionenterkeyhint
allows an author to configure what type of iconify isdisplayed in place for the enter key on virtual keyboards.
Tests: Soon
/dom.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/interaction.html ( diff )