Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#4571 closed defect (fixed)

onChange not being fired with a 0 entered in ValidationTextBox

Reported by: guest Owned by: Douglas Hays
Priority: high Milestone: 1.0
Component: Dijit - Form Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

In _FormWidget.js, there is the following code:

if((this.intermediateChanges
priorityChange) && newValue != this._lastValueReported){

this._lastValueReported = newValue; this.onChange(newValue);

}

The problem is in the newValue != this._lastValueReported. When the value is empty, then _lastValueReported is "". In javascript "" == 0, so when the user enters a 0, the this.onChange is never called. This causes a problem for those wanting to catch a 0 being entered. I have not found a workaround, as setting the value to null automatically sets the value to "". The fix is to make the test be newValue !== this._lastValueReported so that no type conversion takes place.

Change History (3)

comment:1 Changed 12 years ago by bill

Milestone: 1.0
Owner: set to Douglas Hays

comment:2 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [10643]) Fixes #4571. Compare values with !== instead of !=

comment:3 Changed 9 years ago by bill

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