Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Tabs with prop destroyInactiveTabPanel error #3972

Closed
stefnto opened this issue Nov 1, 2024 · 4 comments · Fixed by #3978
Closed

[BUG] - Tabs with prop destroyInactiveTabPanel error #3972

stefnto opened this issue Nov 1, 2024 · 4 comments · Fixed by #3978
Assignees
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@stefnto
Copy link

stefnto commented Nov 1, 2024

NextUI Version

2.4.8

Describe the bug

I'm using the Tabs component with the prop destroyInactiveTabPanel={false} and when the page that contains the tabs opens I get the error

Received the string `true` for the boolean attribute `inert`. Although this works, it will not work as expected if you pass the string "false". Did you mean inert={true}? Error Component Stack
    at div (<anonymous>)
    at NextUI.TabPanel (chunk-MGHLJVLI.mjs:24:13)

only on development mode. On production the error doesn't even show. Removing the prop fixes the error, but I need the inactive tab to not be destroyed, so I need to use the prop.

Your Example Website or App

https://github.com/stefnto/typescript-project

Steps to Reproduce the Bug or Issue

Code is on app/page.tsx so you just navigate to localhost:3000 after opening the dev server

Expected behavior

This error shouldn't show.

Screenshots or Videos

No response

Operating System Version

Windows

Browser

Chrome

Copy link

linear bot commented Nov 1, 2024

@stefnto
Copy link
Author

stefnto commented Nov 1, 2024

I did a bit of digging on the component code and I think the problem is on this file
https://github.com/nextui-org/nextui/blob/canary/packages/components/tabs/src/tab-panel.tsx
line 72 should be
inert={!isSelected ? true : undefined}
without the quotation marks on true

@ShrinidhiUpadhyaya
Copy link
Contributor

Hi @wingkwong, can i work on this?

@wingkwong
Copy link
Member

wingkwong commented Nov 3, 2024

@ShrinidhiUpadhyaya assigned. please take a look how react-aria works on this part. I remember this logic is from there. Or please check the historical PR to see if someone changed that and the reason behind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants