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

[React] Dropdown Menu in example not rendering #1199

Closed
ronnyek opened this issue Apr 20, 2022 · 3 comments
Closed

[React] Dropdown Menu in example not rendering #1199

ronnyek opened this issue Apr 20, 2022 · 3 comments
Assignees

Comments

@ronnyek
Copy link

ronnyek commented Apr 20, 2022

What component (if applicable)

  • Component name: Menu

Describe the bug
I'm not sure if this is problem with example documentation, or the actual menu components, but in attempting to render a layout with code from documentation, profile dropdown menus dont work. I believe an attribute of the menu changes to indicate its open, but never see anything change or dom being modified to include the menu items.

To Reproduce
Steps to reproduce the behavior:

  1. Incorporate react code in example https://tailwindui.com/components/application-ui/application-shells/multi-column#component-b639fa188098a2dbfd9f419c6ef9c6f3
  2. Ensure the html/body changes are applied
  3. Click profile menu
  4. Observe nothing happening except the avatar ring toggling visible / invisible

Expected behavior
I'd expect a popup of the user profile menu to display and hide when clicking user avatar

Screenshots
If I inspect document of the documentation frame, I see something like the following
image

but in the UI my current project renders, none of that code seems to be generated.

Browser/Device (if applicable)

  • OS: windows 10
  • Browser: brave and chrome latest stable
@ronnyek
Copy link
Author

ronnyek commented Apr 20, 2022

As an additional piece of info, the mobile menu also does not display when clicking (when be displaying in window small enough to render as a mobile app.

@RobinMalfait RobinMalfait self-assigned this Apr 20, 2022
@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

I'm guessing that you are using this with React 18. React 18 has StrictMode (enabled by default in Next.js applications) which enables double rendering in development to make your application concurrent mode ready. Try to install the insiders build of Headless UI (we will soon publish version 1.6.0) where we applied fixes for React 18 compatibility (more info: tailwindlabs/headlessui#681)

Hope this helps!

@ronnyek
Copy link
Author

ronnyek commented Apr 20, 2022

Oh this did help... this was exactly the problem, and didn't realize including the fact this was a nextjs app was important here. I appreciate the quick response.

@ronnyek ronnyek closed this as completed Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants