ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
30 stars 8 forks source link

Inconsistent mouse (hover/click) interactions across labeled controls #2331

Open msmithNI opened 1 month ago

msmithNI commented 1 month ago

🐛 Bug Report

Currently we have some inconsistent behavior for mouse interactions on controls that support labels. We should get consensus on the behavior we want, and do a pass over all the controls to ensure they have that behavior.

The main inconsistencies are noted in italics above. So the main thing to determine is if we want to allow label selection (via double clicking label text, mouse drag starting outside control bounds, or both). We should also consider doc/HLD template updates so these are considered for new controls going forward.

fredvisser commented 1 month ago

https://github.com/ni/nimble/issues/393 … captures the need to make all labels selectable, so I think we need to start there.

Different design systems and native components also vary in how they handle label clicks - E.g., single-clicking a text-field label can select the text (native input/Nimble) or focus the cursor at the end of the text (Atlassian, Vivid, Clarity, Fluent… Alright, that convinced me - it seems like most have moved away from the native behavior to prefer the cursor at the end of the text, and we should consider the same.

For double-clicking the label, I don't think we need to design for it - I don't see any components waiting for the second click, so the double-click is pretty consistently handled as 2 single-clicks by the control - and the particular word in the label may end up being selected. It's not a consistent experience anywhere, so I'm assuming it's a low ROI type of problem.