Opened 5 years ago
Closed 5 years ago
#18776 closed defect (patchwelcome)
onChange event on TextBox after set("value", ..., false) then blur
Reported by: | ITA003 | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Dijit - Form | Version: | 1.9.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
HI, I developed a custom website using dojo 1.9.4 and I've a modal popup with a form. In this form I've a DateTextBox? field with onChange event that should be start when the date change. While I open the modal popup I fill the DateTextBox? value with a date using this code:
var updObj = dijit.byId('IDDateTextBox'); updObj.set('value', '2015-01-16', false);
The third parameter because I don't need to fire onChange event when I set this value, but if the user change the value, the onChange event must fire.
But when I open the calendar, without change any value, and exit from the calendar the onChange event fire also the value don't change. Is this a bug or I wrong something?
This is the HTML code of DateTextBox? element:
<input name="TDG004txtDtValuta" type="text" maxlength="10" id="TDG004txtDtValuta" class="InputField" required="true" data-tableref="NOTASPESE_RIGHE" data-fieldref="dtvaluta" data-postback="n" onchange="onChangeFieldValue('TDG004');updateCambioFromValuta(83,'TDG004ddlDsValuta','TDG004txtDtValuta','TDG004txtNmCambio')" data-dojo-type="dijit.form.DateTextBox" />
Change History (3)
comment:1 Changed 5 years ago by
comment:2 Changed 5 years ago by
Hi, the steps are:
- Change the DateTextBox?'s value
- Show the Dialog
- Open Dropdown (I don't change any date value)
- Close Dropdown. The onChange event method starts even if the value is still the same
Thanks.
comment:3 Changed 5 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | new → closed |
Summary: | onChange event on DateTextBox fire on open calendar → onChange event on TextBox after set("value", ..., false) then blur |
I see... actually, you left off step 5, right? To blur the DateTextBox? by clicking somewhere else or tabbing away.
This has nothing to do with DateTextBox? or the Calendar dropdown per se. I can reproduce the problem in test_DateTextBox.html by
- run
dijit.byId("local").set("value", "2016-01-14", false);
in the console - click the first DateTextBox?
- click somewhere else on the page
The "onChange" notification next to the first textbox indicates that onChange was called after the last step.
It's due to this code in _TextBoxMixin.js:
_setBlurValue: function(){ // Format the displayed value, for example (for NumberTextBox) convert 1.4 to 1.400, // or (for CurrencyTextBox) 2.50 to $2.50 this._setValueAttr(this.get('value'), true); },
So, it's a bug. If someone wants to supply a patch for this (and as usual an automated test) then I'd be happy to look at it.
Hmm, I don't know. What do you mean by "While I open the modal popup"? Is it the order below?
I don't think we've done any tests or even thought about changing the DateTextBox?'s value while the dropdown is open.