#16579 closed enhancement (duplicate)
[patch] Select: allow type ahead
Reported by: | Bob Tarling | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Dijit - Form | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Attached is a new contribution to provide type ahead ability in a Dojo Select control.
What I wanted to do was provide the same kind of type ahead ability that is available in a simple html select but with with the look and feel and other features of the Dojo Select.
I provide this as a new KeyboardSelect? control extending the standard Select control (hence I just supply the new file rather than a patch). This ensures there is no issue with backwards compatibility of the Select control for those who may not want this feature.
I placed it in the dojox package, if this contribution is accepted I guess that is the place it would go. Alternatively I would be happy to rework this as a patch to the actual Select control if that is preferred.
I'm also attaching a simple test script. This is also online where you can test this now - http://www.jbob.co.uk/KeyboardSelectDemoSimple.html
The control allows an option to be selected by pressing the first letter of that option label. If the user types another character within 600ms that character is appended to the previous keystroke for the subsequent search. If the user pauses long enough the type ahead goes back to just the single character.
This works if the drop down is visible or if the control simply has focus without the drop down visible.
This is my first contribution and I'd be very happy to accept any criticism to improve this if required. A contributors agreement will follow by email.
Attachments (2)
Change History (10)
Changed 8 years ago by
Attachment: | KeyboardSelect.js added |
---|
Changed 8 years ago by
Attachment: | KeyboardSelectDemoSimple.html added |
---|
Demo script for the KeyboardSelect? control
comment:1 Changed 8 years ago by
Might be able to leverage dijit/_KeyNavContainer for the select's drop down list. Doug recently added letter key search capability to it. In that case it's probably suitable for dijit.
comment:2 Changed 8 years ago by
Please adjust the component field value appropriately on this ticket if dijit is the preferred way to go. I could make my next step a patch to the Select control if that is preferred (even though I provided the code as an extension it seems not the right way to add such a feature to me)
I'm keen to contribute but I would appreciate a little steering. Is there a Dojo developers list I can join to help make sure I provide as required or should we keep discussion to this ticket?
comment:3 Changed 8 years ago by
Component: | DojoX Form → Dijit - Form |
---|---|
Owner: | changed from dante to Douglas Hays |
Summary: | [patch] Allow type ahead in Select → [patch] Select: allow type ahead |
OK, let's try for dijit, and thanks for being keen to contribute. There is a dojo-contributors mailing list but I think writing on the ticket is fine too. There's also #dojo on irc.freenode.net.
comment:5 Changed 8 years ago by
I thought someone might beat me to this, I must be quicker next time :-)
Still, its been a good learning experience.
If nobody confirms this is in 1.9 before I get a chance I will confirm back here myself. For my work so far I was working on the latest public 1.8.3 release. I'll go get a subversion extract. I found instructions here - http://dojotoolkit.org/reference-guide/1.8/developer/svn.html - will my user will have read access (clearly I won't be able to commit)?
comment:6 Changed 8 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #10251.
The new feature can be tested via:
http://archive.dojotoolkit.org/nightly/checkout/dijit/tests/form/test_Select.html
comment:7 Changed 8 years ago by
I notice #10251 does not allow type ahead when the Select control has focus but does not have the list dropped down. A simple html control allows type ahead in this state as does the control I provided.
I will see if I can work out how to resolve just this part with what is currently in svn. All tickets are now closed. Would you prefer such a patch goes to a new ticket or should one of these reopen?
New KeyboardSelect? control that extends Select