Opened 8 years ago
Closed 7 years ago
#18276 closed defect (patchwelcome)
dojox/form/DateTextBox using dojox/widget/MonthAndYearlyCalendar, once set, cannot be cleared
Reported by: | psbucky | Owned by: | dante |
---|---|---|---|
Priority: | undecided | Milestone: | 1.13 |
Component: | DojoX Form | Version: | 1.10.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I am trying to implement an optional month/year selector.
It seems like it SHOULD be as straightforward as:
<span id="foo" data-dojo-type="dojox/form/DateTextBox" data-dojo-props="required:false,constraints:{datePattern:'MM/yyyy'},popupClass:'dojox.widget.MonthAndYearlyCalendar'"></span>
Focusing and blurring leave the field blank, and without error, as expected.
However, once a value is accepted by the widget, it cannot be cleared for love nor money.
Please see attached for example.
Attachments (1)
Change History (5)
Changed 8 years ago by
comment:1 Changed 8 years ago by
More info:
It would seem that you can set and clear the date PROVIDED you do NOT open the popup.
Once you open the popup, even if you choose nothing, a blur event will set the text field to today.
comment:2 Changed 8 years ago by
Component: | General → DojoX Form |
---|---|
Owner: | set to dante |
comment:3 Changed 8 years ago by
This works:
For a widget named "widget," destroy the "dropDown" sub-widget, and set the "dropDown" field to null immediately after closing the drop-down (just doing destroy() didn't work for me). That seems to be the thing that makes the unwanted date value appear, somehow.
Since dijit/form/_DateTimeTextBox deletes the dropDown before every "openDropDown" method, I think I'm requesting that the drop down be destroyed sooner than that--on close.
I don't actually know if the defer is necessary. I'll leave that to wiser programmers.
aspect.after(widget,'closeDropDown',function(){ if(widget.dropDown) { widget.defer(function(){ widget.dropDown.destroy(); widget.dropDown=null; }); } });
comment:4 Changed 7 years ago by
Milestone: | tbd → 1.12 |
---|---|
Resolution: | → patchwelcome |
Status: | new → closed |
Given that no one has shown interest in creating a patch in more than a year, I'm closing this as patchwelcome. Please let us know if you would like to get involved in helping make this change to Dojo!
Example file demonstrating the problem.