Opened 8 years ago
Last modified 6 years ago
#18203 assigned defect
NumberTextBox: Type "-" and move focus out, the widget is not marked as invalid in some cases
Reported by: | jdtang | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | Dijit - Form | Version: | 1.10.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When "places" attribute in "constraints" is set, if typing "-" in NumberTextBox? widget and then moving focus out, the widget is marked as invalid - this is good.
However, when "places" attribute in "constraints" is not set, if typing "-" in NumberTextBox? widget and then moving focus out, the widget is not market as invalid - this is a bug.
This problem can be re-created on http://dojotoolkit.org/reference-guide/1.10/dijit/form/NumberTextBox.html. See attached screenshots.
There is a related bug (https://bugs.dojotoolkit.org/ticket/17382), but the problem I want to report here is different as the one reported in that bug. For that bug, I would consider the behavior is expected (or by design). When the focus is still in the widget, we should not mark the widget as invalid if the text is "-", as user may type number after "-", which will make the input valid. But when the widget loses focus, the widget needs to be marked as invalid if the input is "-", as "-" is not a valid number - this is the problem I want report in this bug.
Attached is a quick fix that we applied. The ideal fix would be fixing the regular expression when "places" attribute in "constraints" is not set.
Attachments (3)
Change History (6)
Changed 8 years ago by
Attachment: | 2014-08-01_16-30-08.png added |
---|
Changed 8 years ago by
Attachment: | 2014-08-01_16-45-53.png added |
---|
Changed 8 years ago by
Attachment: | NumberTextBox.js.patch added |
---|
comment:1 Changed 8 years ago by
Component: | General → Dijit - Form |
---|
comment:2 Changed 7 years ago by
Milestone: | tbd → 1.12 |
---|---|
Owner: | set to dylan |
Status: | new → assigned |
comment:3 Changed 6 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
Our_quick_fix