fix(react-accordion): use inert='true' string attribute instead of boolean on closed panel#36074
Open
fix(react-accordion): use inert='true' string attribute instead of boolean on closed panel#36074
inert='true' string attribute instead of boolean on closed panel#36074Conversation
2 tasks
…ionPanel Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/8efa377d-77f3-42ec-a9b4-f6192d31b226 Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix inert property type on Accordion component
fix(react-accordion): use empty string for Apr 28, 2026
inert attribute instead of boolean
Contributor
|
@copilot generate changelog file with |
Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/2a74c102-f6e8-41d2-9194-7f054cdf91e8 Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Contributor
Author
|
Pull request demo site: URL |
dmytrokirpa
approved these changes
Apr 29, 2026
dmytrokirpa
approved these changes
Apr 29, 2026
dmytrokirpa
reviewed
Apr 29, 2026
…ccordionPanel when closed Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/a189f5ea-ede2-4409-8997-58bfb92e907f Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Copilot
AI
changed the title
fix(react-accordion): use empty string for
fix(react-accordion): use Apr 29, 2026
inert attribute instead of booleanaria-hidden instead of inert attribute on closed panel
… on closed AccordionPanel Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/16951f74-723b-4a57-b75a-6fbdc66a4601 Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Contributor
Author
The changelog file is already present from a previous commit. No additional action needed. |
Copilot
AI
changed the title
fix(react-accordion): use
fix(react-accordion): use empty string for Apr 29, 2026
aria-hidden instead of inert attribute on closed panelinert attribute instead of boolean
dmytrokirpa
approved these changes
Apr 29, 2026
dmytrokirpa
reviewed
Apr 30, 2026
| // tabIndex: -1 prevents the panel itself from being focused, and inert prevents | ||
| // all focusable descendants from being reachable via keyboard navigation. | ||
| ...(open ? {} : { tabIndex: -1, inert: true }), | ||
| ...((open ? {} : { tabIndex: -1, inert: '' }) as React.HTMLAttributes<HTMLDivElement>), |
Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/1f2aa75f-22d0-4d34-86bc-470e17a106f9 Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Copilot
AI
changed the title
fix(react-accordion): use empty string for
fix(react-accordion): use Apr 30, 2026
inert attribute instead of booleaninert='true' string attribute instead of boolean on closed panel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
React warns when a boolean is passed for a non-boolean DOM attribute, and React 19 also warns when an empty string is used for the
inertattribute.AccordionPanelwas settinginert: trueon the root div when the panel is closed. This fix uses'true'as the string value forinertwith a TypeScript cast to resolve the type compatibility issue.Changes
useAccordionPanel.ts: Replacedinert: truewith...((open ? {} : { tabIndex: -1, inert: 'true' }) as React.HTMLAttributes<HTMLDivElement>)— prevents keyboard focus from entering the closed panel while avoiding React DOM warningsAccordionPanel.test.tsx: Updated assertions to verifyinertis set to'true'when the panel is closed andundefinedwhen open@fluentui/react-accordion(patch)