It depends™️.
Agree in this case; really bad idea to not let people select text on whole like that.
There are tons of of cases, however, where not allowing selected text is totally a good behavior in UI.
Agree in this case; really bad idea to not let people select text on whole like that.
There are tons of of cases, however, where not allowing selected text is totally a good behavior in UI.
Which should also be avoided
- Widget labels (time, short text, etc)
- Buttons, when text is just an arrow >
(I know, just use <button>) :)
- When double click makes accidental text selection on UI. I had this for a whole page overlay displaying a song's artist and title. (there's another link to the source with selectable text)- Navigation, but that might be bad too
Good going.
Also video controls that use the UNICODE characters for e.g. play/pause/stop/etc instead of graphic icons (so it scales better at higher DPI). You don't want people to be able to select the text inside the button when pushing the button.
There's actually tons of great usage of user-select: none. This is definitely not one of them though.