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

Dropdown menu in wa-page header appears behind subheader #140

Open
DEfusion opened this issue Jan 12, 2025 · 3 comments
Open

Dropdown menu in wa-page header appears behind subheader #140

DEfusion opened this issue Jan 12, 2025 · 3 comments

Comments

@DEfusion
Copy link

Given the following:

<wa-page>
      <div slot="header">
        <wa-dropdown>
          <wa-button slot="trigger" caret>Dropdown</wa-button>
          <wa-menu>
            <wa-menu-item>Dropdown Item 1</wa-menu-item>
            <wa-menu-item>Dropdown Item 2</wa-menu-item>
            <wa-menu-item>Dropdown Item 3</wa-menu-item>
            <wa-divider></wa-divider>
            <wa-menu-item type="checkbox" checked>Checkbox</wa-menu-item>
            <wa-menu-item disabled>Disabled</wa-menu-item>
            <wa-divider></wa-divider>
            <wa-menu-item>
              Prefix
              <wa-icon slot="prefix" name="gift" variant="solid"></wa-icon>
            </wa-menu-item>
            <wa-menu-item>
              Suffix Icon
              <wa-icon slot="suffix" name="heart" variant="solid"></wa-icon>
            </wa-menu-item>
          </wa-menu>
        </wa-dropdown>
      </div>
      <div slot="subheader">
        <p>I am in the subheader</p>
      </div>
      <main>
           ...
      </main>
    </wa-page>

When you open the dropdown the menu appears behind the subheader because they share the same z-index. I guess in an ideal world wa-dropdown would use popover and then you wouldn't have to worry.

Screenshot by Dropbox Capture

@claviska
Copy link
Member

Indeed! Updating the controls to use the Popover API is on our radar. Until then, using the hoist attribute on the dropdown should help!

@DEfusion
Copy link
Author

Ah-ha hoist missed that, thanks for the tip.

@DEfusion
Copy link
Author

Sadly hoist doesn't seem to help here for some reason, for now I'm overriding the z-index's on the wa-page parts.

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