#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:
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 13 years ago by
Milestone: | → 1.0 |
---|---|
Owner: | set to Douglas Hays |
comment:2 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Note: See
TracTickets for help on using
tickets.
(In [10643]) Fixes #4571. Compare values with !== instead of !=