-
Notifications
You must be signed in to change notification settings - Fork 715
[css-ui] user-select: none and selectionchange event #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi. I feel like I missing a bit of context, so I am not sure I fully follow what you're asking, but if I get it right, you think:
For the first item, I think this is reasonable, but I am not sure it should be mandated: if UAs want to do something else (e.g. trying to select a user-select:none element cancels the current selection), maybe that's ok.
On the other hand, regardless of whether we include the requirement above or not, if the selection is indeed not changed, I agree no event should be fired. But that's out of scope for this spec: this event is not defined in css-ui-4, but in the selection API spec. The current definition there seem to say what you'd want, but if you want clarifications to it, I suggest filing an issue there. |
Agenda+:
or
Chrome and Firefox do the first one, but and Edge Safari do the second one. Do we want to align behavior one way or the other, or are we comfortable with leaving this up to the UA? |
I think it's Firefox only that does the first one (and in my opinion the right behaviour) Chrome 54.0.2816.0 dev-m (64-bit) / win10: http://i.imgur.com/KfMaBGa.gif |
You're right. Chrome's behavior is somewhere in between: if you have a selection, and simply click in a |
We need some input from the editing task force on this. |
Just for the record, Safari is doing the same as Chrome: nothing if you just click, unselect if you drag. |
I would definitely expect to have no selection related behavior when clicking such element. Neither the current selection changes nor the selectionchange event is fired. Click events are expected ofc. It's also reasonable to assume that only the selection can be dragged. Therefore, if clicking an element doesn't move the selection to it, dragging should have no effect on the current selection. If such dragging instead crosses the element boundaries and moves over selectable text, then it is acceptable that the selection changes, performing the usual dragging operation to select such text. |
I agree with @fredck. One thing that this could be used for is the UI toolbar of a text editing app. Setting |
Agreeing with Firefox's behavior. Will fix this in Edge: https://msedgeportal.trafficmanager.net/en-us/microsoft-edge/platform/issues/8888287/ |
Since both Edge and Chrome intend to match Firefox, and with feedback from multiple people involved in js-based editors (CKEditor's fredck, Johannes and caub) going in the same direction, we have a strong candidate for resolving this:
|
Uh oh!
There was an error while loading. Please reload this page.
https://drafts.csswg.org/css-ui-4/#propdef-user-select
Follow up from https://bugs.chromium.org/p/chromium/issues/detail?id=621543, it's a behavior at the limit between CSS and JS. Firefox doesn't fire selectionchange events and doesn't change the text selection when clicking in an element with a
user-select: none
parent. Chromium and Edge don't respect thatThe text was updated successfully, but these errors were encountered: