Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

feat: add divider & group label to menu & menu list, #198 #199

Merged
merged 5 commits into from
Apr 27, 2022

Conversation

SarahHouben
Copy link
Member

fixes: #198

TSIA

Screenshot 2022-04-26 at 16 10 05

@SarahHouben SarahHouben requested a review from a team April 26, 2022 15:11
Copy link
Member

@diondiondion diondiondion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SarahHouben, this is looking good so far! I noticed a few issues, see comments.

It'd also be great if you could give the Menu component a test run using a screen reader to see if the new group headers are announced properly. (It's not necessarily a bug if they don't, as menu groups seem slightly non-standard and aren't mentioned in the WAI-ARIA practices.)

src/MenuList/index.js Outdated Show resolved Hide resolved
src/MenuList/index.js Outdated Show resolved Hide resolved
src/Menu/MenuItemDivider.js Outdated Show resolved Hide resolved
src/Menu/MenuItemGroup.js Outdated Show resolved Hide resolved
src/Menu/MenuItemGroup.js Outdated Show resolved Hide resolved
src/Menu/MenuItemGroup.js Outdated Show resolved Hide resolved
src/Menu/README.stories.mdx Outdated Show resolved Hide resolved
@SarahHouben
Copy link
Member Author

Thanks @SarahHouben, this is looking good so far! I noticed a few issues, see comments.

It'd also be great if you could give the Menu component a test run using a screen reader to see if the new group headers are announced properly. (It's not necessarily a bug if they don't, as menu groups seem slightly non-standard and aren't mentioned in the WAI-ARIA practices.)

So, when it comes to announcing of the group headers, the screen reader sometimes does it (see screenshot) but most of the times it skips them. Not really sure why it's behaving that way tbh. Most of the time it just announced "label, menuitem, group"

Screenshot 2022-04-27 at 12 51 18

Copy link
Member

@diondiondion diondiondion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's just one more issue around the default element used for the MenuList components – sorry if my previous comment about that wasn't super clear. Otherwise this looks great, thank you!

@@ -18,7 +18,7 @@ function MenuList({children}) {
ref={popover.setRef}
arrow={popover.arrow}
>
<MenuListUI.Wrapper {...menuListProps}>
<MenuListUI.Wrapper role="menu" {...menuListProps}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary here, menuListProps already contains the role:

base5-ui/src/Menu/Menu.js

Lines 114 to 116 in 8d5949a

const menuListProps = {
ref: menuListRef,
role: 'menu',

But it would be great if you could add as="div" here, and revert the changes made to the styled.x definitions made in MenuList/index.js. Those should still default to ul/li as before (for example for the NavMenu component which doesn't add any roles), and should only be overridden when a role is provided.

Suggested change
<MenuListUI.Wrapper role="menu" {...menuListProps}>
<MenuListUI.Wrapper as="div" {...menuListProps}>

The same would have to be done for the MenuItem component: https://github.com/5app/base5-ui/blob/master/src/Menu/MenuItem.js#L22

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, sorry, I completely misunderstood earlier. 😬

@SarahHouben SarahHouben merged commit 3a04bb6 into master Apr 27, 2022
@SarahHouben SarahHouben deleted the 198-MenuList-update branch April 27, 2022 13:35
5app-Machine added a commit that referenced this pull request Apr 27, 2022
# [14.11.0](v14.10.0...v14.11.0) (2022-04-27)

### Features

* add divider & group label to menu & menu list, [#198](#198) ([#199](#199)) ([3a04bb6](3a04bb6))
@5app-Machine
Copy link
Contributor

🎉 This PR is included in version 14.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MenuList/MenuList: Add Divider and GroupLabel components
3 participants