kobalte icon indicating copy to clipboard operation
kobalte copied to clipboard

Closing DropdownMenu by clicking outside highlights first item on a touch device

Open dannylin108 opened this issue 9 months ago • 1 comments

Describe the bug If on a touch device (chrome emulation also works) close DropdownMenu by clicking outside, first item gets highlighted.

See official example from docs:

https://kobalte.dev/docs/core/components/dropdown-menu

To Reproduce Steps to reproduce the behavior:

  1. Open official example on a touch device
  2. Click on the trigger 'Git settings'
  3. Click outside to close the Dropdown
  4. While menu content is fading out, you can clearly see that first item ("Commit") got highlighted.

Expected behavior It should not get highlighted, as it works on a desktop.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Brave (mobile emulation), Chromium (mobile emulation)

Smartphone (please complete the following information):

  • Device: Samsung
  • OS: Android
  • Browser Brave Mobile

dannylin108 avatar Mar 21 '25 08:03 dannylin108

Indeed; curiously enough though, this is only applicable to dropdown menu. Other components like menubar don't seem to have the same behaviour.

Similarly, this only applies to the root dropdown menu. If a sub-menu is open, then neither the first item of the sub-menu, nor the parent menu are highlighted.

shayanhabibi avatar Sep 20 '25 05:09 shayanhabibi