#5971 closed defect (fixed)
DateTextBox does not always show an error with required=true
Reported by: | Douglas Hays | Owned by: | haysmark |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | Dijit - Form | Version: | 1.1b1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Run test_DateTextBox.html
Click on the 2nd textbox and the calendar popup appears. Select a date.
Erase all text in the same textbox w/o loosing focus.
Tab or click away and there's no error even though the field is required
and the onChange should probably show undefined or blank.
Attachments (1)
Change History (6)
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Summary: | ComboBox does not always show an error with required=true → DateTextBox does not always show an error with required=true |
comment:2 Changed 14 years ago by
Furthermore, this bug only happens the first time. If you repeat the procedure after you get the error state, it works as expected.
comment:3 Changed 14 years ago by
This is an order of operations bug in ValidationTextBox?. The ValidationTextBox? template invokes _onMouse onblur, before focus manager calls Widget's _onBlur. But the error handling in validate(), which is triggered by _onMouse, checks to see if _onBlur has been called yet:
this.state = (isValid || (!this._hasBeenBlurred && isEmpty)) ? "" : "Error";
Hence, when you delete all of the text from a ValidationTextBox? for the first time, it doesn't matter whether a blank value is valid or invalid because we have allowed blank values to be valid the first time through. The code expects _onBlur to fire first, but this is not the case.
Changed 14 years ago by
Attachment: | 5971.patch added |
---|
Fixes #5971. Focus manager sets _hasBeenBlurred to true on widgets it blurs.
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 Changed 11 years ago by
Component: | Dijit → Dijit - Form |
---|
Seems that validation only happens while the calendar is open.