Replies: 13 comments 2 replies
-
It might be nice to investigate a "menu" with links (which should not be menuitems), and one with both links and menuitems at the same time. They're technically very comparable, and offering these would give users alternatives when a "menu" might not be the best fit. |
Beta Was this translation helpful? Give feedback.
-
in aria example of menubar, there is links with role="menuitem". We could have something like that: <lion-menu>
<button slot="invoker">Open</button>
<lion-menu-content role="menu" slot="content">
<a href="/link1" role="menuitem">Link 1</a>
<a href="/link2" role="menuitem">Link 2</a>
<button @click="${()=>{}}" role="menuitem">Action 1</a>
</lion-menu-content>
</lion-menu> The only thing is that the slotted anchors can't have a mixin applied (like DisabledMixin). But the disabled state can maybe be handled by the |
Beta Was this translation helpful? Give feedback.
-
To be more accommodating, |
Beta Was this translation helpful? Give feedback.
-
Hi all, We have researched/discussed this quickly within the team and came up with the following: Accessible Examples
The first 4 are aligned with each other, so we will end up with something like: <div class="menu_button">
<button type="button"
id="menubutton"
aria-haspopup="true"
aria-controls="menu2">
WAI-ARIA Quick Links
</button>
<ul id="menu2"
role="menu"
aria-labelledby="menubutton">
<li role="none">
<a role="menuitem"
href="https://www.w3.org/"
tabindex="-1">
W3C Home Page
</a>
[...]
</li>
</ul>
</div> All examples only allows either buttons or anchors, since it can be confusing for the users when mixing them. API<lion-menu>
<button slot="invoker">Open</button>
<lion-menu-content slot="content">
<a menu-type="menu-item" href="/link1">Link 1</a>
<a menu-type="menu-item" href="/link2" >Link 2</a>
<hr menu-type="separator">
<a menu-type="menu-item" href="/link3" >Link 3</a>
</lion-menu-content>
</lion-menu> Or <lion-menu>
<button slot="invoker">Open</button>
<lion-menu-content slot="content">
<button menu-type="menu-item" @click="${()=>{}}">Action 1</button>
<button menu-type="menu-item" @click="${()=>{}}">Action 2</button>
</lion-menu-content>
</lion-menu> API possible 2nd iteration<lion-menu>
<lion-button slot="invoker">Open</ing-button>
<lion-menu-content slot="content">
<lion-menu-submenu label="sub list" menu-type="menu-item">
<a href="/link1" menu-type="menu-item">Link 1</a>
<a href="/link2" menu-type="menu-item">Link 2</a>
</lion-menu-submenu>
<a href="/link3" menu-type="menu-item">Link 3</a>
</lion-menu-content>
</lion-menu> Technical details
|
Beta Was this translation helpful? Give feedback.
-
the submenu could maybe be done by recursion with <lion-menu>
<button slot="invoker">Open</button>
<lion-menu-content slot="content">
<lion-menu menu-type="menu-item">
<button slot="invoker">sub list</button>
<lion-menu-content slot="content">
<a menu-type="menu-item" href="/link1">Link 1</a>
<a menu-type="menu-item" href="/link2" >Link 2</a>
</lion-menu-content>
</lion-menu>
<hr menu-type="separator">
<a menu-type="menu-item" href="/link3" >Link 3</a>
</lion-menu-content>
</lion-menu> And why using in your examples |
Beta Was this translation helpful? Give feedback.
-
Our main a11y expert @erikkroes is on holiday, but he is in big favour of the Disclosure-navigation with links, which would also work for buttons. See below email:
This will also simplify the internal code for the menu.
|
Beta Was this translation helpful? Give feedback.
-
another reason why One thing we didn't discuss yet is how will this look on mobile? 🤔 bottom sheet? |
Beta Was this translation helpful? Give feedback.
-
Menu exists on mobile too (in material design for example). But I suppose the menu actions could be replaced by a bottom sheet on mobile. I suppose it depends on the use case. |
Beta Was this translation helpful? Give feedback.
-
on iOS, there is Pull-down menus too. |
Beta Was this translation helpful? Give feedback.
-
I'm in favour of a menu implementation on mobile rather than bottom sheet |
Beta Was this translation helpful? Give feedback.
-
I have something already started and I could open a pull request. Let me know if I have the go ahead |
Beta Was this translation helpful? Give feedback.
-
please go ahead - best would be with tests only so we can focus on the public API 👍 but a demo/proof of concept is always helpful as well 🤗 |
Beta Was this translation helpful? Give feedback.
-
There is no news about this, right? |
Beta Was this translation helpful? Give feedback.
-
Menu component
I'd like to propose a
lion-menu
component be added to the set of Navigation components.Aesthetically similar to a dropdown menu or
lion-select-rich
. The purpose of this component would be to navigate between a variable number of views of equal or differing importance.Implementations of
lion/menu
should adhere to https://www.w3.org/TR/wai-aria-practices-1.1/#menuAPI
Beta Was this translation helpful? Give feedback.
All reactions