-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] - Switch Component isDisabled
Prop Not Working When Inside Table Component
#3012
Comments
isDisabled
Prop Not Working When Inside Table ComponentisDisabled
Prop Not Working When Inside Table Component
@Hashim1995 Have you tried the latest version? There're quite lots of changes between 2.2.9 and the latest. |
@wingkwong Yes, I updated to the latest version but the problem is still not solved. |
@Hashim1995 thanks for confirmation. I'll have a look later. |
@Hashim1995 Can you provide a minimal reproducible environment on stackblitz? A video for demonstration would be appreciate. When I trigger |
@wingkwong, thank you for your feedback. I've located a Stackblitz repository that utilizes nextui; unfortunately, I wasn't able to bootstrap a new Stackblitz repo specifically for next.ui. Although the repository is based on Next.js, which I do not use, the issue persists across frameworks. The main problem I'm encountering is with the isDisabled prop of the Switch component. It functions correctly outside of a table but fails to work when placed inside a table. I would appreciate it if you could review the code and provide any insights you might have |
@Hashim1995 Thanks for the reproducible example. I could see the problem there. However, I copied your code in Stackblitz and tried it on my local storybook. This is the result and somehow it's working fine. Therefore, I'd put this issue on hold first and retry after the next release (scheduled on 20th May). issue3012-demo.webm |
@wingkwong Thanks! It seems like a version error (but i tried different versions), perhaps a conflict with other packages. It looks like a really weird problem :) |
Closing - please use the latest version (v2.4.0) |
NextUI Version
2.2.9
Describe the bug
When placing a
**Switch**
component inside a**Table**
component, the**isDisabled**
property fails to function as expected. The**Switch**
remains active and clickable regardless of the**isDisabled**
state being set to true. However, when the sameSwitch
is used outside of theTable
, theisDisabled
property works as intended. This inconsistency suggests a potential issue with howTable
orSwitch
handle property or state propagation.Here is my snippet:
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
**Table**
component with a**TableBody**
containing multiple**TableRow**
components.**TableRow**
, include a**Switch**
component.**isDisabled**
prop of the**Switch**
based on a state variable that changes (e.g., upon clicking a button outside the table).**Switch**
does not respect the**isDisabled**
state while inside the**Table**
.**Switch**
component outside theTable
and observe that it respects the**isDisabled**
state.Expected behavior
The Switch component should consistently respect the isDisabled property, regardless of whether it is placed inside or outside of the Table component. The expected behavior is that the switch becomes disabled/enabled based on the state provided to isDisabled.
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
The text was updated successfully, but these errors were encountered: