-
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
Dialog uses open/closed state from Context over props #1308
Comments
Hey! Thank you for your bug report! This is indeed a bug and we should prefer local props over context information. The reason this exists is to make Transitions easier. Here is an example: https://headlessui.dev/react/menu#transitions Currently working on React 18 compatibility so this won't be fixed immediately. |
Run into the same bug. The dropdown that uses Disclosure components won't work unless i change Should we keep using React 17 for now? Just following this issue for now. |
@gusflopes you are describing a React 18 issue, checkout the pinned issue #681. I'm also confused about what you mean with a "Dropdown" that uses the "Disclosure" component 🤔 |
Hey! Thank you for your bug report! This should be fixed by #1360, and will be available in the next release. You can already try it using:
Here is an updated CodeSandbox: https://codesandbox.io/s/headless-bug-repro-forked-29kf0e |
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
1.5.0
Reproduction URL
https://codesandbox.io/s/headless-bug-repro-3fz4dz?file=/src/App.js
Hi!
I ran into this when triggering a Dialog to open from inside a Disclosure component. It was a little surprising as the docs say
In any case this seems to be where the passed in value is getting over ridden if I am understanding the code correctly.
I think the best course of action is to remove all references to
usesOpenClosedState
but if not, preferring the passed in value makes sense!headlessui/packages/@headlessui-react/src/components/dialog/dialog.tsx
Lines 174 to 180 in ab6310c
The text was updated successfully, but these errors were encountered: