3 ms·
thats a different point, being able to drag something (currently disabling text select events) doesnt mean text isnt selectable, if you drag over and entire pag
by daleharvey 17y ago
thats a different point, being able to drag something (currently disabling text select events) doesnt mean text isnt selectable, if you drag over and entire page the text is still selected. its especially annoying if you have to support shift + arrow keyboard shortcuts.
- pilif 17y agoif the default action of these drag & drop events was to enable drag & drop, then you would not be able to select anything on the page (using the mouse that is), because, wherever you push the button down and move the mouse, you will initiate a drag operation and not a select operation. This is why drag & drop is disabled by default and the method in which it is disabled is by making the events fire but have their default action to not allow drag & drop which then leads to the selection action being used.
- wvenable 17y agoIsn't this solved by the "draggable" attribute? Why work at the events-level at all for this.
- pilif 17y agofrom an architecture standpoint, the solution using events is actually cleaner: Instead of having a flag that toggles some events default action, you have override the event default action where you need it changed. If you need the attribute (or even a class="draggable" to achieve your goal without changing the standard), you can use libraries like jQuery. What I'm saying is: * I disagree with the author of the articles assumption that the default event action is wrongly set. If it was the other way around, selection of page elements would not be possible. * The events is what we have in the standard. I would probably prefer the flag aswell, but from a architecture standpoint, using the events is probably much easier to implement. * If I want to have that attribute, I can easily add it to my sites script code using one or two lines of jQuery-code.