#9945 closed task (fixed)
Migrate widgets to use _HasDropDown
Reported by: | Nathan Toone | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.6 |
Component: | Dijit | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
The following widgets should be migrated to use the common _HasDropDown code:
- dijit.form.ComboBox
- dijit.form.FilteringSelect (extends from ComboBox)
- dijit.form._DateTimeTextBox
- dijit.form.DateTextBox (extends from _DateTimeTextBox)
- dijit.form.TimeTextBox (extends from _DateTimeTextBox)
Attachments (1)
Change History (25)
comment:1 Changed 11 years ago by
Component: | DojoX Form → Dijit |
---|
comment:2 Changed 11 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 10 years ago by
Milestone: | future → 1.6 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
comment:5 Changed 10 years ago by
Description: | modified (diff) |
---|
(In [22555]) Convert _DateTimeTextBox to extend _HasDropDown, so it gets an icon (down arrow button) to open the drop down. The icon's display is controlled by a hasDownArrow parameter, same as ComboBox.
Tabbing into the widget no longer causes the drop down to (automatically) open. Clicking the field causes the drop to open, although that behavior can be disabled by setting the new "openOnClick" parameter to false. Of course, clicking the down arrow button (if it's displayed) will always open the drop down.
Changed _HasDropDown to not expect the drop down widget (this.dropDown) to exist initially, prior to the user clicking the down arrow, as DateTextBox creates it on demand. Also fixed the connections for the key handlers, which should clearly be on this.focusNode rather than this._buttonNode.
Had to modify _TimePicker some because the handleKey() callback from _HasDropDown is being called on keyup rather than keypress like before, so evt.charOrCode isn't set. Maybe _HasDropDown should be monitoring keypress rather than keyup.
Made a new DropDownBox.html template used for DateTextBox/TimeTextBox, and expected to be used for ComboBox/FilteringSelect once I get those converted to extend _HasDropDown.
Open issues include:
- confirm aria roles are correct
- mouseover of the fields in the _TimePicker no longer makes them expand in width
- TimeTextBox needs more tests
comment:6 Changed 10 years ago by
comment:7 Changed 10 years ago by
Changed 10 years ago by
patch (for sake keeping); haven't resolved when to call evt.preventDefault() on the SPACE key (yes for Button, Select, no for *Box)
comment:8 Changed 10 years ago by
comment:9 Changed 10 years ago by
comment:10 Changed 10 years ago by
comment:11 Changed 10 years ago by
(In [22658]) Fix bug introduced in DateTextBox --> _HasDropDown conversion where SPACE character is no longer accepted as direct keyboard input into the box. (It needs to be accepted since "September 9, 1999" is a valid date format.)
I fixed this by removing the code from _HasDropDown to prevent IE screen jump on space/enter/down arrow keys. I can't reproduce that bug anymore, even as far back as dojo 1.1, nor can I find a ticket about it. If it turns out we need the code after all, then have to make it conditional so it runs for <span>/<div>/<input type=button>, but not for <input type=text> (or type=password).
As a side note, with the hasDownArrow=false setting, the SPACE character will open the drop down rather than appearing as input, so it can't (currently) be used in conjunction with long format dates.
Refs #9945 !strict.
comment:12 Changed 10 years ago by
comment:13 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [22660]) Convert ComboBox to extend _HasDropDown. The migration involved:
- make ComboBox use the code in _HasDropDown to open/close/size the drop down, and the code to monitor for clicks/keypresses to open/close drop down
- a lot of renaming: this._popupWidget --> this.dropDown, this.downArrowNode --> this._buttonNode, this.comboNode --> this.domNode, this._isShowingNow --> this._opened, _onKeyPress --> _onKey, _hideResultList --> closeDropDown
- removed "state" from _HasDropDown since it conflicted with ValidationTextBox.state and since it had the same meaning as this._opened
- added maxHeight: -1 setting to _HasDropDown to cap the drop down size to what will fit in the viewport
Since ComboBox's drop down opens asynchronously this was a tricky change, because _HasDropDown wasn't really designed for the drop down to open asynchronously, except for the first time it's shown, when it's loading from an href.
Fixes #9945, #11461 !strict. Refs #10229 but doesn't fix completely.
comment:14 Changed 10 years ago by
comment:15 Changed 10 years ago by
comment:16 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
After [22604], TimeTextBox? can no longer filter times by typing the hour. Refs #11485. In test_TimeTextBox.html, 4th box, you have to type "133" to get it to only show times starting with "13". Everything seems 1 character off.
comment:17 Changed 10 years ago by
Good catch. I made TimeTextBox._onKey() [re]open the drop down based on the new contents of the <input>, but _onKey() executes before the keystroke is reflected into the <input> (ie, the browser default handling of the keypress event).
comment:18 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:19 Changed 10 years ago by
comment:20 Changed 10 years ago by
comment:21 Changed 10 years ago by
comment:22 Changed 10 years ago by
(In [22852]) [22660] accidentally removed the dojo.connect() for the compositionend handler, for triggering drop down filtering upon entering Japanese/Chinese? characters. Turns out though that code is no longer needed, FF must have fixed their bug. Refs #9945 !strict.
comment:23 Changed 10 years ago by
(In [24141]) For the sake of backwards compatibility, make onClick() fire for clicks on down arrow, and let that click event propagate (i.e. don't call dojo.stopEvent()). In 2.0 though I don't want to spend bytes supporting esoteric events like ComboBox.onClick at all. Fixes #12520, refs #9945 !strict on 1.6/ branch.
comment:24 Changed 10 years ago by
(In [24143]) For the sake of backwards compatibility, make onClick() fire for clicks on down arrow, and let that click event propagate (i.e. don't call dojo.stopEvent()). In 2.0 though I don't want to spend bytes supporting esoteric events like ComboBox.onClick at all. Fixes #12520, refs #9945 !strict on trunk.
Just marking as dijit so it shows up in my reports.