WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Problems with role="tree"

for

From: Birkir R. Gunnarsson
Date: May 13, 2018 4:38AM


Without having looked at your code, it looks like the problem is that
you don't set focus to a treeitem when user navigates to the tree, ,
just to the tree itself.

See this explanation of a tree widget from ARIA authoring Practices
https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView

(also check out the examples, both source code and test them with NvDA).
The tre itself has no accessible name, so there is no text for the
screen reader to read wen it receiveds focus.
You could give it a name with aria-label, but I still don't think it
solves the fundamental issue.
The issue is that you can't set focus to the tree itself, you must set
focus to an item inside the tree, either the selected item (if user
has selected one) or the first item in the tree (if user has not
selected one).
so
<div role="tree" aria-label="foo">
Div role="treitem" tabindex="0">I get focus first</div>
...
</div>


or (if you want to implement his using aria-activedescendant):
<div role="tree" tabindex="0" aria-label="foo" aria-activedescendant="act">
<div tabindex="-1" id="act" role="treeitem">I get focus first</div>
...
</div>
Then you can move id="act" between treeitems in response to how the
user navigates the tree.



On 5/12/18, Alexander Karelas < <EMAIL REMOVED> > wrote:
> Are you a core developer of NVDA, by the way?
>
>
> On 13/05/2018 12:28 πμ, Jonathan Cohn wrote:
>> I can try to look at this later, but did you use a aria-activedescendent
>> attribute on the tree item? Generally it seems that ARIA wants tab inex=0
>> on exactly one child of the complex widgets or tabindex=0 on the parent
>> element with the active item indicated with the active descendent.
>>
>>
>>
>> On Sat, May 12, 2018 at 4:27 PM Alexander Karelas < <EMAIL REMOVED> >
>> wrote:
>>
>>> Should I file an issue on NVDA's github repo?
>>>
>>>
>>> On 12/05/2018 10:36 μμ, Jonathan Pool wrote:
>>>>> If they press Enter while on the region, or NVDA+Space, they hear the
>>>>> clicking sound, but the current tree item doesn't get read out.
>>>>>
>>>>> The only way I managed to have the active treeitem read, is by pressing
>>>>> the Tab key, but I think that might not be an optimal way to surf to
>>>>> the
>>>>> tree, as it will first cycle through all of the links of the page,
>>>>> which
>>>>> could be many.
>>>>>
>>>>> So what am I doing wrong on my page? How do I solve it? Is it possible
>>>>> that this could be an imperfection of NVDA?
>>>>>
>>>>> Removing the region that wraps the tree doesn't seem right, because
>>>>> then
>>>>> the 'd' key cannot be used to surf to the tree, only the Tab key will
>>>>> do, which has the problem I mentioned above
>>>>>
>>>>> What do I do? How does someone use this page?
>>>>>
>>>>> Any help will be greatly appreciated. Thanks.
>>> >>> >>> >>> >>>
>> >> >> >> >
> > > > >


--
Work hard. Have fun. Make history.