Opened 9 years ago
Closed 9 years ago
#15132 closed defect (duplicate)
dijit/focus should not call _onFocus before onmousedown can be seen
Reported by: | Douglas Hays | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.7.3 |
Component: | Dijit | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
You should be able to see onmousedown followed by onfocus (or _onFocus). But since dijit/focus.js uses the capture=true flag, and then calls _onFocus from the mousedown handler, event handlers waiting on the mousedown see the _onFocus first (and this.focused=true) before seeing the mousedown event. This is causing the failure in robot/ValidationTextBox (placeholder::type in textbox). Chrome and Firefox won't focus the widget's focusNode automatically on mouse down and without seeing the mousedown event before focus, then I don't know ifI should manually change the focus or not. This needs to be fixed in 1.7.3 since it worked OK in 1.7.2. Since then, _FormWidgetMixin is looking for the focus after onmousedown.
Attachments (1)
Change History (4)
Changed 9 years ago by
Attachment: | 15132.patch added |
---|
comment:1 Changed 9 years ago by
Component: | Dijit - Form → Dijit |
---|---|
Milestone: | tbd → 1.7.3 |
Owner: | changed from Douglas Hays to bill |
Status: | new → assigned |
comment:2 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 9 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Duplicate of #13341.
In other tickets like #13341 and #14838 I've suggested that people use native onfocus events rather than relying on the focus manager.
I'm reluctant to add a setTimeout() to that code since setTimeout() can lead to so many complications. I suppose if we did have a setTimeout(), it would be to trigger the so-called _onFocus() event when there was a mousedown event which wasn't followed by a focus event (such as the case of clicking the non-focusable up/down arrows on a spinner).
Perhaps since this has come up a number of times I should do that. In any case I'll track this in #13341.
possible fix