Opened 7 years ago
Last modified 4 years ago
#17537 new defect
dijit.form.Select: error if keypress and less than two options
Reported by: | Stanislav_Strelchik | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | Dijit - Form | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
We have a dijit.form.Select on our form. When it contains less than 2 options than key press leads to an error:
For example, in FF 17.0.10 esr:
Timestamp: 10/30/2013 5:50:12 PM Error: TypeError: item is null Source File: https://dojotoolkit.org/reference-guide/1.9/_static/js/dijit/_KeyNavMixin.js Line: 285
This error occurs inside a loop in _keyboardSearch function:
do{ var rc = this._keyboardSearchCompare(currentItem, searchString); if(!!rc && numMatches++ == 0){ matchedItem = currentItem; } if(rc == -1){ // priority match numMatches = -1; break; } currentItem = this._getNextFocusableChild(currentItem, 1); }while(currentItem != stop);
It happens when this._getNextFocusableChild(currentItem, 1) returns null and on the next iteration of the loop calls this._keyboardSearchCompare(currentItem, searchString) with null currentItem.
Steps to reproduce:
- Open attached sample.
- Select 'Tennessee' option.
- Press a few keys.
Attachments (1)
Change History (4)
Changed 7 years ago by
Attachment: | dojo_select.html added |
---|
comment:1 Changed 6 years ago by
We just ran across this one too: http://jsfiddle.net/tv2gs37b/2/ TypeError?: 'null' is not an object (evaluating '_14.domNode')
comment:2 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|
We should investigate and fix in 1.12 if possible. Pull requests are welcome of course!
comment:3 Changed 4 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
dijit.form.Select sample with 1 option from "https://dojotoolkit.org/reference-guide/1.9/dijit/form/Select.html"