Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#3164 closed defect (fixed)

dijit.form.Textbox contains an error preventing entering 0 values.

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

Description

dijit.form.Textbox.setValue(value) defined like that (in lines 52-55):

setValue: function(value){
  this._setTextValue(!value ? "" : this.format(value, this.constraints));
  dijit.form.Textbox.superclass.setValue.call(this,value);
},

It means that if value is evaluated to false it will be replaced by an empty string. This is the case for dijit.form.NumberTextbox, and, by proxy, for dijit.form.CurrencyTextbox. If somebody tries to enter totally legal value of 0, it will be replaced by the empty string, which is less than desirable in general cases. This problem can be reproduced in the test page: try to enter legal 0 values as Age, Elevation, or Annual Income.

I am assigning this ticket to Bill, so he can reassign it later to a proper contributor.

Change History (3)

comment:1 Changed 12 years ago by bill

Owner: changed from bill to Douglas Hays

Giving to Doug.

comment:2 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [8795]) Fixes #3164. Added explicit test for undefined or null values.

comment:3 Changed 8 years ago by bill

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