Open UweOhse opened 4 years ago
Bliss.delegate(document.body, "dragstart", "[draggable=true]", function(e) { /* nothing */ }); leads to the exception in the title if one drags a text, because a dragstart event runs, and is handled here:
Bliss.delegate(document.body, "dragstart", "[draggable=true]", function(e) { /* nothing */ });
delegate: overload(function (type, selector, callback) { $.bind(this, type, function(evt) { if (evt.target.closest(selector)) { callback.call(this, evt); } }); }, 0, 2),
evt.target unfortunately is a text in this case, and has no closest() method.
A fix is simple: if (evt.target.closest && evt.target.closest(selector)) { (tested, works)
if (evt.target.closest && evt.target.closest(selector)) {
btw: bliss is great. thank you very much.
Thanks for reporting! I've added it to my radar.
Actually, a better fix would be to use evt.parentNode.closest() in this case which is essentially what you need.
evt.parentNode.closest()
Bliss.delegate(document.body, "dragstart", "[draggable=true]", function(e) { /* nothing */ });
leads to the exception in the title if one drags a text, because a dragstart event runs, and is handled here:evt.target unfortunately is a text in this case, and has no closest() method.
A fix is simple:
if (evt.target.closest && evt.target.closest(selector)) {
(tested, works)btw: bliss is great. thank you very much.