Skip to content

Commit 9fe0aa7

Browse files
fix(tabs): correct inert value for true condition (#3978)
1 parent 8de427b commit 9fe0aa7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/twelve-papayas-clean.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nextui-org/tabs": patch
3+
---
4+
5+
revise the inert attribute in `TabPanel` (#3972)

packages/components/tabs/src/tab-panel.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ const TabPanel = forwardRef<"div", TabPanelProps>((props, ref) => {
6969
data-focus={isFocused}
7070
data-focus-visible={isFocusVisible}
7171
data-inert={!isSelected ? "true" : undefined}
72-
inert={!isSelected ? "true" : undefined}
72+
// makes the browser ignore the element and its children when tabbing
73+
// TODO: invert inert when switching to React 19 (ref: https://github.com/facebook/react/issues/17157)
74+
// @ts-ignore
75+
inert={!isSelected ? "" : undefined}
7376
{...(isSelected && mergeProps(tabPanelProps, focusProps, otherProps))}
7477
className={slots.panel?.({class: tabPanelStyles})}
7578
data-slot="panel"

0 commit comments

Comments
 (0)