Opened 12 years ago
Closed 11 years ago
#8595 closed defect (fixed)
_onFocus() fires on disabled widgets
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Dijit | Version: | 1.2.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
As noted in [16433], clicking on a disabled widget causes _onFocus() to be fired. This doesn't seem right.
Note that the reason clicking causes _onFocus() to fire at all is so clicking the up/down buttons for a Spinner (or the open button for a ComboBox's drop down) will note that said widget is active, even though it didn't cause an actual focus event.
Change History (5)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Milestone: | 1.5 → 1.6 |
---|
comment:4 Changed 11 years ago by
Milestone: | 1.6 → 1.5 |
---|
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [22011]) Fixes so that disabled widgets don't get focus by mouse or keyboard:
- Made focus manager ignore click events on disabled widgets. It still responds to actual focus events so that Menu still works (which focuses the disabled MenuItems). Clicking a disabled dijit.form.Button in an enabled TabContainer will call onFocus() on the TabContainer (and the ContentPane) but not the Button.
- Fixed _FormWidget._setDisabledAttr() to set/remove tabIndex on all focusable nodes. Usually only focusNode is focusable, but ComboButton has two focusable nodes. Disabling a widget now sets tabIndex=-1 on nodes like <button> but removes tabIndex on nodes like <div>.
- Added new method dijit.hasDefaultTabStop() to support above code.
The only remaining problem is webkit, where clicking widgets still gives them focus, but this is a webkit bug that doesn't seem feasible to workaround. I did add workaround code for webkit so at least keyboard works correctly, by using tabIndex=-1 instead of removing tabIndex (see #11064 for details).
See also #8903, #8923, likely manifestations of this problem.