Skip to content

[Bug]: (nav, sideNav, Dropdown) Incorrect handling of dropdown menu visibility when using nav and sidenav #515

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

Closed
3 tasks done
gselderslaghs opened this issue Oct 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gselderslaghs
Copy link
Member

gselderslaghs commented Oct 14, 2024

Before submitting...

Context

Implementing a dropdown button inside navbar and sidenav results in not showing the dropdown menu when clicked on desktop version.

Codepen

Materialize navbar sideNav Dropdown

Current Behavior

I've implemented a dropdown menu as suggested by the Materialize documentation Navbar Dropdown Menu

I've extended the setup with the sideNav component
The dropdown HTML element is only appended next to the latest triggering element on the page
When activating the dropdown trigger from the desktop nav, this results in the dropdown component is not being visible to the end user, since the sidenav is not opened at this state. When you activate the sidenav in mobile mode, the dropdown is functioning as expected

Expected behavior

The dropdown element should be visible, in any case, when a trigger for the element is activated

Possible Solutions or Causes

As it would be possible to workaround by adding an additional dropdown with exactly the same items but with a different id and data-target, this would be a very dirty workaround

Ideally we should analyse possible solutions on how this could be fixed

  • within the nav and sidenav setup and without affecting the dropdown component since it has a broader usage
  • with a single dropdown component declaration that is triggered from nav and sidenav

Steps to reproduce

  1. Implement the nav and sidenav component
  2. Implement a single dropdown component
  3. Implement the dropdown trigger link in nav and sidenav

Your Environment

  • Version used: 2.1.1
@gselderslaghs gselderslaghs added the bug Something isn't working label Oct 14, 2024
gselderslaghs added a commit to gselderslaghs/materialize that referenced this issue Oct 29, 2024
wuda-io added a commit that referenced this issue Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant