Opened 5 years ago

Last modified 3 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)

2014-08-01_16-30-08.png (5.9 KB) - added by jdtang 5 years ago.
2014-08-01_16-45-53.png (7.1 KB) - added by jdtang 5 years ago.
NumberTextBox.js.patch (749 bytes) - added by jdtang 5 years ago.
Our_quick_fix

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by jdtang

Attachment: 2014-08-01_16-30-08.png added

Changed 5 years ago by jdtang

Attachment: 2014-08-01_16-45-53.png added

Changed 5 years ago by jdtang

Attachment: NumberTextBox.js.patch added

Our_quick_fix

comment:1 Changed 5 years ago by bill

Component: GeneralDijit - Form

comment:2 Changed 4 years ago by dylan

Milestone: tbd1.12
Owner: set to dylan
Status: newassigned

comment:3 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.