Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(exoflex): support a11y for menu item #457

Merged
merged 2 commits into from
Apr 27, 2020

Conversation

oshimayoan
Copy link
Contributor

Add a11y support for native and web Menu Item component.

@oshimayoan oshimayoan mentioned this pull request Apr 22, 2020
10 tasks
@oshimayoan oshimayoan added wip Work in progress and removed ready for review labels Apr 23, 2020
@oshimayoan oshimayoan marked this pull request as draft April 23, 2020 04:41
@oshimayoan oshimayoan added ready for review and removed wip Work in progress labels Apr 23, 2020
@oshimayoan oshimayoan marked this pull request as ready for review April 23, 2020 06:23
@@ -2,6 +2,7 @@ import React from 'react';
import { Menu as PaperMenu } from 'react-native-paper';
import Text from './Text';
import useTheme from '../helpers/useTheme';
import { AccessibilityProps, View } from 'react-native';

export type MenuProps = OmitPaperTheme<typeof PaperMenu>;
Copy link
Contributor

Choose a reason for hiding this comment

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

What about accessibility for Menu?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I skipped it as we can't access inside Paper's Menu. But should we just wrap it in a View and put the a11y props into that View similar to what I did with the Menu Item?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, let's wrap the Menu inside a View, similar to Menu Item.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it kinda feels off by doing that as the component that we wrapped turns out to be the anchor instead of the parent of Menu.Item.

Here is the wrapper that we give a role as menu.
image

From the image above, the wrapper (menupopup) is only wrapping the anchor which is a button. That's why it doesn't show any menu item from the tree.

And here is the menu item.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And this is what the tree looks like with Radio.
image

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. In that case, I'm indifferent on whether we add the menu accessibility at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright then, I think we could just skip it until Paper implement it or we fork Paper and implement it from there.

@oshimayoan oshimayoan merged commit 8b24822 into kodefox:master Apr 27, 2020
@oshimayoan oshimayoan deleted the exoflex/a11y-menu branch April 27, 2020 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants