patternfly / patternfly/patternfly-react
MenuToggle - add aria-controls prop to relate toggle and content it controls
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 862
- Forks
- 392
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 9
Description
Describe the problem
With PF6, the dropdown menu popover is by default parented to the root. When the menu is open, there is no attribute which relates the popover menu back to the toggle button which opened it.
react-table ActionColumn is an example where PF owns both components but there's still no relation. It would be possible to override the MenuToggle by supplying a custom actionsToggle function.
In writing this issue, I realize it may not be possible without "hacks" for PF to relate the two when the application controls the rendering of both the toggle and menu separately.
Having a relationship between the two at the dom level would help with test automation such as cypress.
How do you reproduce the problem?
Go to https://www.patternfly.org/components/menus/dropdown
Open a dropdown menu
Using web inspector, inspect the dropdown toggle and popover menu parented to the root. Observe there is no attribute relating the two.
Expected behavior
Expected some attribute present, wether arbitrary or a11y requirement, to relate the two dom nodes.
Is this issue blocking you?
It is possible to supply an ID which then gets applied to the popover menu.
What is your product and what release date are you targeting?
RHOAI
Jira Issue: PF-998
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PatternFly dropdown documentation example and the MenuToggle API described in the issue. Trace how the toggle and root-parented popover are rendered, then define the prop behavior so the two DOM nodes receive a relationship; verify the result in the dropdown example and its accessibility or interaction tests if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100