Open caub opened 8 years ago
http://jsfiddle.net/crl/rk6f74tw/14/ for me this is actually better than the current selectionchange event
update: I've aslso been in a situation where I need to know a 'target' for the selection change, or other times I needed an event type that triggered that change in selection.
Since selection change is always triggered by another event (I think), wouldn't it be better to include more information in this event?
I've done things like http://jsfiddle.net/rk6f74tw/34/ (check console and select content either in the blue menu or elsewhere) as also a polyfill, but it's of course more heavy
When using user-select:none CSS property, it doesn't work the same on all browsers, I posted bugs on edge and chrome, only Firefox (nightly, because they forgot to enable selectionchange on current releases) doesn't send selectionchange event on element with user-select:none, which makes sense to me.
selectionchange is really useful, it would be even better if the event parameter of the callback could say more about what triggered the selection change, either passing a MouseEvent, a KeyEvent etc.. or giving a type property to the event
the idea is to have something like that http://jsfiddle.net/crl/rk6f74tw/12/