WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Roles for nest lists

for

Number of posts in this thread: 4 (In chronological order)

From: Greg Gamble
Date: Fri, Dec 11 2015 11:36AM
Subject: Roles for nest lists
No previous message | Next message →

I have a nested list ... is it given the same roles as the parent?

<ul role="list" >

<li role="listitem" >xxx</li>

<ul role="list" >

<li role="listitem" >xxxx</li>

<li role="listitem" >xxxx</li>

</ul>

<li role="listitem" >xxxxx</>

<ul>

Greg
e: = EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS REMOVED = > | www.sbctc.edu<;http://www.sbctc.edu/>;

From: Léonie Watson
Date: Fri, Dec 11 2015 11:41AM
Subject: Re: Roles for nest lists
← Previous message | Next message →

> From: WebAIM-Forum On Behalf Of Greg Gamble
> Sent: 11 December 2015 18:36
>
> I have a nested list ... is it given the same roles as the parent?

It is, but you don't need to use the roles if you're using the HTML ul/li elements.

<ul>
<li>Fruit
<ul>
<li>Apples</li>
<li>Bananas</li>
</ul></li>
<li>Vegetables</li>
</ul>

Or

<div role="list">
<span role="listitem">Fruit>
<div role="list">
<span role="listitem">Apples</span>
<span role="listitem">Bananas</span>
</div></span>
<span role="listitem">Vegetables</span>
</div>


Note: The use of div and span in the second example is arbitrary. You could use all spans or all divs for example.


Léonie.

--
@LeonieWatson tink.uk Carpe diem

From: Greg Gamble
Date: Fri, Dec 11 2015 11:54AM
Subject: Re: Roles for nest lists
← Previous message | Next message →

OK makes sense .... but if the roles of list and listitem are being used, shouldn't they be in a marked up list in the first place?


Greg

-----Original Message-----
From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Léonie Watson
Sent: Friday, December 11, 2015 10:42 AM
To: 'WebAIM Discussion List'
Subject: Re: [WebAIM] Roles for nest lists

> From: WebAIM-Forum On Behalf Of Greg Gamble
> Sent: 11 December 2015 18:36
>
> I have a nested list ... is it given the same roles as the parent?

It is, but you don't need to use the roles if you're using the HTML ul/li elements.

<ul>
<li>Fruit
<ul>
<li>Apples</li>
<li>Bananas</li>
</ul></li>
<li>Vegetables</li>
</ul>

Or

<div role="list">
<span role="listitem">Fruit>
<div role="list">
<span role="listitem">Apples</span>
<span role="listitem">Bananas</span>
</div></span>
<span role="listitem">Vegetables</span>
</div>


Note: The use of div and span in the second example is arbitrary. You could use all spans or all divs for example.


Léonie.

--
@LeonieWatson tink.uk Carpe diem

From: Greg Gamble
Date: Fri, Dec 11 2015 12:03PM
Subject: Re: Roles for nest lists
← Previous message | No next message

OK, I found this article by Steve Faulkner
https://specs.webplatform.org/html-aria/webspecs/master/

I understand now ... thanks.


Greg


-----Original Message-----
From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Greg Gamble
Sent: Friday, December 11, 2015 10:55 AM
To: = EMAIL ADDRESS REMOVED = ; WebAIM Discussion List
Subject: Re: [WebAIM] Roles for nest lists

OK makes sense .... but if the roles of list and listitem are being used, shouldn't they be in a marked up list in the first place?


Greg

-----Original Message-----
From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Léonie Watson
Sent: Friday, December 11, 2015 10:42 AM
To: 'WebAIM Discussion List'
Subject: Re: [WebAIM] Roles for nest lists

> From: WebAIM-Forum On Behalf Of Greg Gamble
> Sent: 11 December 2015 18:36
>
> I have a nested list ... is it given the same roles as the parent?

It is, but you don't need to use the roles if you're using the HTML ul/li elements.

<ul>
<li>Fruit
<ul>
<li>Apples</li>
<li>Bananas</li>
</ul></li>
<li>Vegetables</li>
</ul>

Or

<div role="list">
<span role="listitem">Fruit>
<div role="list">
<span role="listitem">Apples</span>
<span role="listitem">Bananas</span>
</div></span>
<span role="listitem">Vegetables</span>
</div>


Note: The use of div and span in the second example is arbitrary. You could use all spans or all divs for example.


Léonie.

--
@LeonieWatson tink.uk Carpe diem