Opened 7 years ago
Closed 5 years ago
#18095 closed defect (invalid)
NumberTextBox: change event on <input> DOM node is flaky
Reported by: | chmielot | Owned by: | bill |
---|---|---|---|
Priority: | blocker | Milestone: | 1.11 |
Component: | Dijit - Form | Version: | 1.9.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Bug affects all version from 1.8.0 (since then, widget events are published to DOM). Bug appears in Chrome 35.0.1916.153 on a Mac and on Windows. Bug does not appear in Firefox. Locale is de_DE.
When using NumberTextBox? the change event is not always triggered, when bound to the DOM node. In the attachment find a simple test case.
Steps to reproduce: 1) Type 53 into the field 2) Press tab key, alert appears, onchange worked. 3) Type 54 into the field 4) Blur by clicking somewhere else => alert appears, onchange worked. 5) Type 1022 into the field 6) Press tab key, onchange works 7) Type 1023 into the field 8) Blur by clicking somewhere else => alert does not appear(!)
It seems to be connected to the thousands-separator (dot "." in my locale) and thus to some formatting function. This problems also affects CurrencyTextBox? which automatically appends a currency and doesn't trigger onchange event when bluring the field by clicking somewhere else.
Attachments (1)
Change History (6)
Changed 7 years ago by
comment:1 Changed 7 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | set to bill |
Priority: | undecided → high |
Status: | new → assigned |
comment:3 Changed 6 years ago by
For people that are having the same problem: a workaround is to bind the blur event directly on the dijit object, not on its DOM node.
comment:4 Changed 5 years ago by
Priority: | high → blocker |
---|
comment:5 Changed 5 years ago by
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Summary: | change event is not triggered on "formatted" NumberTextBox → NumberTextBox: change event on <input> DOM node is flaky |
Sorry, but (as you seem to have figured out), you need to listen to the change event on the widget itself, not on the widget's focusNode, i.e:
widgetId.on("change", callback);
Or alternately, do it declaratively,
Your test is doing:
on(dom.byId('testid'), on.selector('input', 'change'), function() { alert('test'); });
I can see why you want to do it that way, to use event delegation, but unfortunately that's not supported.
Simple test case