Combobox dropdown remains open after disabling component #3106
Unanswered
hokennethk
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey all,
Not sure if this is expected behavior, but it seems a bit odd to me.
I have some code where I am using a combobox to add people to a list.
After the list reaches a max number, I want to disable the combobox to prevent further additions.
I do this by checking my list length, and adding a
disabled
attribute to the combobox at the list limit.However, if I add the disabled attribute to the combobox, the combobox select dropdown remains open.
It will not close if I click outside, since the component is disabled.
Is there a way to achieve what I want? Or is this a bug?
Here's a minimal reproduction:
https://codesandbox.io/p/sandbox/heuristic-napier-prfp52?file=%2Fsrc%2FApp.tsx
A screen recording:
Screen.Recording.2024-04-18.at.10.44.22.AM.mov
Beta Was this translation helpful? Give feedback.
All reactions