radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
15.54k stars 794 forks source link

focus-visible triggered when open a dialog from a dropdown menu using mouse. #2545

Open yuezk opened 10 months ago

yuezk commented 10 months ago

Bug report

:focus-visible style is triggered when open a dialog from a dropdown menu using mouse.

Current Behavior

https://github.com/radix-ui/primitives/assets/3297602/54f67dbd-92bf-4dc5-a2aa-8f00f57585f8

If the dialog is not opened from the dropdown menu, the :focus-visible style won't be triggered.

Expected behavior

The :focus-visible style should not be triggered.

Reproducible example

The example is forked from https://github.com/radix-ui/primitives/issues/1836#issuecomment-1556688048

Edit DropdownMenu + Dialog items (forked)

Suggested solution

Additional context

Your environment

Software Name(s) Version
Radix Package(s)
React n/a
Browser
Assistive tech
Node n/a
npm/yarn
Operating System
jrnxf commented 1 month ago

Any chance we could get a timeline on this?

alivault commented 1 month ago

Same here. It should use focus instead of focus-visible when the dialog is triggered without using the keyboard.