Opened 8 years ago
Last modified 4 years ago
#16157 assigned defect
dnd: replace evt.stop with evt.preventDefault in Selector.onMouseDown
Reported by: | Simon Speich | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | DnD | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dnd.Selector.onMouseDown() calls event.stop(e) on line 268/196 (to prevent the browser from selecting text when the user drags?).
But this prevents using the event mousedown higher up in the DOM hierarchy (e.g. event delegation) and should therefore be replaced with event.preventDefault() instead, which does not cancel the bubbling up. Also see fixed ticket #13994.
Change History (5)
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
Workaround:
define([ 'dojo/_base/declare', 'dojo/on', 'dojo/dnd/Selector' ], function(declare, on, Selector) { return declare([Selector], { onMouseDown: function(evt) { // onMouseDown calls stopPropagation(), which prevents setting context // -> add it back with emit() this.inherited('onMouseDown', arguments); on.emit(evt.target, 'mousedown', { bubbles: true, cancelable: true }); } }); });
and then use map property in dojoConfig:
var dojoConfig = { map: { 'dojo/dnd': { 'dojo/dnd/Selector': 'yourOwnModule/dnd/Selector' } } };
comment:4 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|---|
Owner: | changed from Eugene Lazutkin to dylan |
Status: | new → assigned |
comment:5 Changed 4 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
Note: See
TracTickets for help on using
tickets.
#16805 is a duplicate of this ticket.