Skip to content

Unexpected behavior when <KDropdown> is wrapped inside <KLabel> #3099

@kingyue737

Description

@kingyue737

KM-2290

I encountered some strange behavior when placing <KDropdown> inside <KLabel>:

  1. Clicking the trigger immediately fires the first menu item's onClick

When clicking the <KDropdown> trigger, it seems to immediately trigger the onClick of the first menu item. As a result, the menu closes right away.

This issue does not occur when the trigger is a native element.

  1. Clicking anywhere inside a flex <KLabel> triggers the dropdown

If <KLabel> has display: flex, clicking anywhere inside the <KLabel> (even outside the actual dropdown trigger) will trigger the <KDropdown>'s onClick.

This makes the entire label area behave as if it were the dropdown trigger, which is unexpected.

Reproduction: https://stackblitz.com/edit/vitejs-vite-8eimaiwe

20260220-0414-03.4141394.mp4

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