Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#8903 closed defect (fixed)

ComboButton: disabled can still get focus

Reported by: bill Owned by: bill
Priority: high Milestone: 1.5
Component: Dijit - Form Version: 1.3.0b3
Keywords: Cc: Douglas Hays
Blocked By: Blocking:


On test_Button.html in FF, in the console do:

dijit.byId("save").attr("disabled", true);

Then click the disabled button. It still gets focus. Tabbing from previous buttons also sets a tab stop there.

I'll check in tests for this into Button_a11y.html, commented out. Uncomment when this is fixed.

Change History (8)

comment:1 Changed 13 years ago by Becky Gibson

Cc: Douglas Hays added

comment:2 Changed 13 years ago by Douglas Hays

Hopefully this s related: the disabled ComboBox? in test_ComboBox.html can be focused and shows the dotted outline (I'm testing with FF2 on WinXP). Looks like 2 issues: 1) this._focused=true (focus manager problem), and 2) in dijit.css, dijitDisabled disables the cursor but not the outline CSS attribute.

comment:3 Changed 12 years ago by Becky Gibson

Component: AccessibilityDijit
Owner: Becky Gibson deleted

Why is this accessibility? Setting back to dijit.

comment:4 Changed 12 years ago by bill

Milestone: tbd1.5

See #8595, probably the root cause of this.

comment:5 Changed 12 years ago by bill

Milestone: 1.51.6

comment:6 Changed 12 years ago by bill

Milestone: 1.61.5
Owner: set to bill
Status: newassigned

Changed my mind, will fix this for 1.5.

comment:7 Changed 12 years ago by bill

Resolution: fixed
Status: assignedclosed

(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).

Fixes #8903, #8923, #8595, #11053, refs #11064 !strict.

comment:8 Changed 11 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.