Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: use empty string for inert attribute instead of boolean in AccordionPanel to prevent React DOM warning",
"packageName": "@fluentui/react-accordion",
"email": "198982749+Copilot@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('AccordionPanel', () => {
<AccordionItemProvider value={mockAccordionItemContextValue({ open: false })}>{children}</AccordionItemProvider>
);
const { result } = renderHook(() => useAccordionPanelBase_unstable({}, ref), { wrapper });
expect(result.current.root.inert).toBe(true);
expect(result.current.root.inert).toBe('true');
expect(result.current.root.tabIndex).toBe(-1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const useAccordionPanelBase_unstable = (
// Prevent keyboard focus from entering the panel while it is closed/collapsing.
// 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: 'true' }) as React.HTMLAttributes<HTMLDivElement>),
},
{ elementType: 'div' },
),
Expand Down
Loading