Skip to content

Commit

Permalink
fix(tabs): correct inert value for true condition (#3978)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrinidhiUpadhyaya authored Nov 3, 2024
1 parent 8de427b commit 9fe0aa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/twelve-papayas-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/tabs": patch
---

revise the inert attribute in `TabPanel` (#3972)
5 changes: 4 additions & 1 deletion packages/components/tabs/src/tab-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ const TabPanel = forwardRef<"div", TabPanelProps>((props, ref) => {
data-focus={isFocused}
data-focus-visible={isFocusVisible}
data-inert={!isSelected ? "true" : undefined}
inert={!isSelected ? "true" : undefined}
// makes the browser ignore the element and its children when tabbing
// TODO: invert inert when switching to React 19 (ref: https://github.com/facebook/react/issues/17157)
// @ts-ignore
inert={!isSelected ? "" : undefined}
{...(isSelected && mergeProps(tabPanelProps, focusProps, otherProps))}
className={slots.panel?.({class: tabPanelStyles})}
data-slot="panel"
Expand Down

0 comments on commit 9fe0aa7

Please sign in to comment.