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

[number field] Increment and Decrement can be clicked when disabled #1443

Open
mj12albert opened this issue Feb 13, 2025 · 3 comments · May be fixed by #1462
Open

[number field] Increment and Decrement can be clicked when disabled #1443

mj12albert opened this issue Feb 13, 2025 · 3 comments · May be fixed by #1462
Assignees
Labels
bug 🐛 Something doesn't work component: number field This is the name of the generic UI component, not the React module! has workaround

Comments

@mj12albert
Copy link
Member

Repro: https://codesandbox.io/p/sandbox/cocky-kepler-y5j9tz

This sets the disabled attribute in the DOM but they are still clickable:

<NumberField.Decrement disabled>

<NumberField.Increment disabled>
@mj12albert mj12albert added bug 🐛 Something doesn't work component: number field This is the name of the generic UI component, not the React module! labels Feb 13, 2025
@GalindoSVQ
Copy link

If you want to disable, you need to disable the root element instead of the decrement/increment buttons

@mj12albert
Copy link
Member Author

mj12albert commented Feb 17, 2025

Maybe this is not so likely in userland, but in my case (#1349) the disabled state can't be passed directly to the Root: https://github.com/mui/base-ui/pull/1349/files#diff-72aed59a3c9228e3356be5fc00fd2ee07c218049d48127e5e75e2dca9252c5bfR207-R248

@mj12albert

This comment has been minimized.

@mj12albert mj12albert self-assigned this Feb 18, 2025
@oliviertassinari oliviertassinari changed the title [NumberField] Increment and Decrement can be clicked when disabled [number field] Increment and Decrement can be clicked when disabled Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: number field This is the name of the generic UI component, not the React module! has workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants