primitives icon indicating copy to clipboard operation
primitives copied to clipboard

[Dialog/Select] Selection mode is active after choosing an item in Select in Firefox

Open alexandre-lim opened this issue 2 years ago • 5 comments

Bug report

Current Behavior

Following this discussion https://github.com/radix-ui/primitives/discussions/1484#discussioncomment-2993174.

Using Dialog 0.1.8-rc.47 and Select 0.1.2-rc.49 in Firefox 101.0.1, after choosing an item in Select, selection mode is activated and text content in Dialog is highlighted on hover.

Screenshot 2022-06-21 at 20 36 20

Expected behavior

After choosing an item in Select component, text in Dialog is not highlighted on hover.

Reproducible example

CodeSandbox Template

Choose option 1 from the select and hover on the text Very basic modal, it will be on selection mode and highlight the text.

alexandre-lim avatar Jun 21 '22 18:06 alexandre-lim

Seeing the same behavior with Dropdown after close

selfish avatar Jul 19 '22 15:07 selfish

I've been having the same problem using Dialog version 0.1.7 and Select version 0.1.1.. After the Select (drop-down) closes - the mouse cursor remains on selection mode and needs another mouse click to break free.

yotamZaken avatar Jul 20 '22 09:07 yotamZaken

After being puzzled by this for quite a while, I realized that the example implementation adds a style to the SelectItem, which my project was missing. This fixed the bug for me.

.select__item { user-select: none; }

llStaraill avatar Sep 06 '22 06:09 llStaraill

I can confirm the solution provided by @llStaraill fixes the issue with Firefox. @andy-hook perhaps we should consider this a functional style (especially given native menus don't allow you to select item text anyway and the action is on pointerup).

benoitgrelard avatar Sep 06 '22 09:09 benoitgrelard

perhaps we should consider this a functional style (especially given native menus don't allow you to select item text anyway and the action is on pointerup).

I agree

andy-hook avatar Sep 06 '22 09:09 andy-hook

+1

eiiot avatar Feb 04 '23 01:02 eiiot