Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#9537 closed defect (invalid)

ComboBox and FilteringSelect does not allow options with same value with different case to be selected onChange or onBlur

Reported by: vmanchal Owned by: Douglas Hays
Priority: high Milestone: tbd
Component: Dijit - Form Version: 1.0
Keywords: case senstive options Cc: vmanchal@…
Blocked By: Blocking:

Description (last modified by bill)

The FilteringSelect? widget does not allow the user to select the same value with different case whether it's onChange or OnBlur?. For example, if the options are values "value1", "VALUE1", "value2", "value3"...so on. After user selects "value1", if the user selects "VALUE1" from the dropdown list, the value reverts back to "value1" again. This happens on all browser and all platforms.

######## code snippet from dijit.form.ComboBox? widget ##############

_onBlur: function(){
    // summary: called magically when focus has shifted away from   this widget and it's dropdown
    this._hasFocus=false;
    this._hasBeenBlurred = true;
    this._hideResultList();
    this._arrowIdle();
    // if the user clicks away from the textbox OR tabs away, set the value to the textbox value
    // #4617: if value is now more choices or previous choices, revert the value
    var newvalue=this.getDisplayedValue();
    if(this._popupWidget&&    (newvalue==this._popupWidget._messages["previousMessage"]||newvalue==this._popupWidget._messages["nextMessage"])){
				    this.setValue(this._lastValueReported, true);
    }else{
	this.setDisplayedValue(newvalue);
    }
},

########################################

If the else part is commented, everything works fine as expected.

Change History (4)

comment:1 Changed 10 years ago by vmanchal

To be clear, the value selected on the onChange event is correct. It updates the textbox with the correct value. The problem is with onBlur on the textbox. It is onBlur, it reverts back to the previous value.

comment:2 Changed 10 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Owner: changed from anonymous to Douglas Hays

comment:3 Changed 10 years ago by haysmark

Resolution: invalid
Status: newclosed

Hi, I followed your test case and indeed reproduced your issue with FilteringSelect?.

Please refer to the ComboBox? API:

// ignoreCase: Boolean
//		Set true if the ComboBox/FilteringSelect should ignore case when matching possible items
ignoreCase: true,

Set ignoreCase to false on all on ComboBoxes? and FilteringSelects? relying on case-sensitive data. Leave the else in your application as removing it may cause an unsafe loss of error checking.

comment:4 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.