Skip to content

CDropdown doesn't autoClose if menu items are buttons #446

@yurii-novikov-jetbeep

Description

@yurii-novikov-jetbeep

I have updated to newest @coreui/[email protected] and found a bug that was not reproduced in version 5.5.0

In our project we use CDropdowns a lot, sometimes items are links and sometimes they are buttons, like in your example: https://coreui.io/react/docs/components/dropdown/#menu-items (looks like the link doesn't work, so please see the screenshot 1)

I expect that when I click on the button - the dropdown will be closed, but it doesn't. I found the check in the code (screen 2) that prevents closing. I understand that it covers the case when forms are inside, but my scenario becomes broken.

I need a way to close the dropdown on button click, so what are my options?

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions