Opened 6 years ago
Closed 5 years ago
#18590 closed defect (worksforme)
Tab complete for ComboBox tabs to the next control
Reported by: | jbest | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.11 |
Component: | Dijit - Form | Version: | 1.10.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Here is an example: http://jsfiddle.net/cubfa3r5/3/
Steps:
- Click run on the fiddle
- Select all the text in the US States combobox and clear it out
- Start typing Ariz
- The autocomplete should pop up as "Arizona", hit "TAB" to make the completion
- The next form element gets focus
Should TAB be selecting the autocomplete value AND tabbing to the next control? It seems like it should be stopping the TAB from bubbling the event.
Change History (6)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
You can see this behavior also on the second control in test_ComboBox.html. I think it's by design but I really don't remember. Why do you think it would be useful to keep focus on the control even though the user has already completed filling in the value? In general I think when the user hits the TAB key they are finished with inputting the value and ready to move on to the next control.
About the PR, it probably breaks the existing regression tests (ComboBox_a11y.html etc.).
comment:3 Changed 6 years ago by
Well the default behavior for ENTER is to implicitly submit the form, but the code that handles ENTER prevents bubbling of that. So we have a case where the default behavior of ENTER is overwritten and TAB is extended. Wouldn't you run into issues where ComboBox? is extended to support multiple values (http://dojotoolkit.org/reference-guide/1.10/dojox/form/MultiComboBox.html)? Tabbing once would tab out to the next control.
comment:4 Changed 6 years ago by
Well the default behavior for ENTER is to implicitly submit the form, but the code that handles ENTER prevents bubbling of that.
Yes, of course. We need to do that to prevent the form being submitted prematurely, if someone uses ENTER to auto-complete the value.
Wouldn't you run into issues where ComboBox? is extended to support multiple values?
I agree that in that case, TAB should not move to the next control.
comment:5 Changed 5 years ago by
Milestone: | tbd → 1.11 |
---|
comment:6 Changed 5 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Sorry, as I wrote above I don't think we should change the current behavior.
Also, I tried to see how native form completion works (see http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_form_autocomplete), and at least on chrome/mac, the tab key will auto-complete *and* move to the next form control. You have to hit the down arrow first though; otherwise it just moves to the next form control without auto-completing.
Pull request: https://github.com/dojo/dijit/pull/95