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

Ability to nest Toolbar.Item as an opening button for a DropdownMenu #515

Closed
Xstoudi opened this issue Jul 1, 2023 · 5 comments
Closed

Comments

@Xstoudi
Copy link
Contributor

Xstoudi commented Jul 1, 2023

This example:

    <DropdownMenu
      trigger="click"
      onSelect={selectOption}
      options={filterOptions}
    >
      <Toolbar.Item title="Filters">
        <FaFilter />
      </Toolbar.Item>
    </DropdownMenu>

leads to having two button tag nested, which trigger the following warning:

Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>.
@targos
Copy link
Member

targos commented Jul 3, 2023

Do you have a suggestion to fix it?

@Xstoudi
Copy link
Contributor Author

Xstoudi commented Jul 6, 2023

I can't find a really satisfying solution right now that wouldn't break the idea of the design system.

Best idea right now would be to replace (or add an option to) the Toolbar.Item's button by a div tag with role="button" attribute.

@Xstoudi Xstoudi added this to Pixelium Jul 6, 2023
@Xstoudi Xstoudi moved this to Known bugs in Pixelium Jul 6, 2023
@targos
Copy link
Member

targos commented Jul 7, 2023

Conceptually, you want the dropdown's trigger to be your toolbar item. I think we need to change the API to accept that. In other words, an option to render your own trigger button.

@stropitek
Copy link
Contributor

@targos duplicate of #612?

@targos
Copy link
Member

targos commented Dec 15, 2023

Seems like it.

@stropitek stropitek closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2024
@github-project-automation github-project-automation bot moved this from Known bugs to Done in Pixelium Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants