#2558 closed defect (fixed)
ComboBox: default selection of 'Iowa' becomes 'Iowaka'
Reported by: | Owned by: | Douglas Hays | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Widgets | Version: | 0.4.1 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
If you load this page and simply hit the drop down in Combo Box #1, you'll notice that the default selection of 'Iowa' becomes 'Iowaka'. This is due the following code within _openResultList in ComboBox.js (lines 704-707 in dojo 0.41 build on the community source site): if( (this.autoComplete)&& (results.length)&& (!this._prev_key_backspace)&& (this.textInputNode.value.length > 0)){ var cpos = this._getCaretPos(this.textInputNode); // only try to extend if we added the last character at the end of the input if((cpos+1) > this.textInputNode.value.length (code needed here to check that input matches our first result??) ){ // only add to input node as we would overwrite Capitalisation of chars this.textInputNode.value += results[0][0].substr(cpos); // build a new range that has the distance from the earlier // caret position to the end of the first string selected this._setSelectedRange(this.textInputNode, cpos, this.textInputNode.value.length); } }
Attachments (1)
Change History (3)
Changed 15 years ago by
Attachment: | test_ComboBox_2558.html added |
---|
comment:1 Changed 15 years ago by
I have updated that code to check to see if the entered text begins the text of the 0th result.
Note: See
TracTickets for help on using
tickets.
test file