Opened 15 years ago

Closed 15 years ago

#2899 closed task (fixed)

Dijit: add focusNode

Reported by: bill Owned by: davidb
Priority: high Milestone: 0.9beta
Component: Accessibility Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


Add focusNode attribute to all widgets (with something focusable), and common code to set tabIndex to 0 or -1 depending on whether widget is enabled or disabled.

Attachments (1)

focusNode.diff (6.8 KB) - added by davidb 15 years ago.
possible fix

Download all attachments as: .zip

Change History (10)

comment:1 Changed 15 years ago by davidb

Owner: changed from Becky Gibson to davidb

comment:2 Changed 15 years ago by davidb

Status: newassigned

comment:3 Changed 15 years ago by davidb

Component: WidgetsAccessibility

comment:4 Changed 15 years ago by davidb

Would this be the idea (?) :

  1. add focusNode attributes in widget templates.
  2. add focusNode attribuutes programmatically where necessary (basically hunt for programmatic tabIndex setAttribute cases and replace them).
  3. allow multiple focus nodes per widget? (e.g. combobutton template has two nodes with tabIndex)
  4. in FormElement?.js, add logic for setting tabIndex when enable/disable is called and during initialization? What about Widget.js? Is this intended to be more general?

comment:5 Changed 15 years ago by Becky Gibson

The issue is to be able to identify the focusNode of a widget as this is the node that the ARIA role and state values need to be set on. The problem can be see in the setValue function of the form base: The setValue function calls dijit.util.wai.setAttr(this.domNode, "waiState", "valuenow", passedInValue); The problem is setting the valuenow property on this.domNode. The valuenow property needs to be set on the element that has the role and gets focus, and that may not be the domNode in all cases. For example, in the spinner the dojoAttachPoint with waiRole="spinbutton" is textbox.

At a dijit meeting we discussed updating form's setValue to call setAttr() with this.focusNode as the parameter. We need a way to specify the focusNode for each widget. So, we need a focusNode attribute and a way to set it. In order to do this we probably need to update dojoAttachPoint to be able to take more than one value since the focusNode may also be the domNode or it could be the container node. I would separate setting tabindex from the task of allowing the template to specify the focusNode.

comment:6 in reply to:  5 Changed 15 years ago by davidb

Replying to becky: Thanks very much for the clarification; I recall the discussion but hadn't mentally connected it with this ticket.

comment:7 Changed 15 years ago by bill

The patch looks good to me, except I'm a little concerned about setting a <span> to the focus node... see bug #3039.

comment:8 Changed 15 years ago by davidb

Hi Bill, I looked at 3039 but couldn't discern the specific issue. Note the span element already had a tabindex of 0 (putting it in the tab order)

Changed 15 years ago by davidb

Attachment: focusNode.diff added

possible fix

comment:9 Changed 15 years ago by Becky Gibson

Resolution: fixed
Status: assignedclosed

(In [8645]) fixes #2899 committed for David Bolter

Note: See TracTickets for help on using tickets.