Skip to content

Commit

Permalink
fix issue LeaVerou#234, event.target.closest might not be defined whe…
Browse files Browse the repository at this point in the history
…n dragging text
  • Loading branch information
UweOhse committed Apr 18, 2024
1 parent df7ea9e commit 6cdbb58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/delegate.js
Expand Up @@ -3,7 +3,7 @@ import bind from "./bind.js";

function delegate (subject, type, selector, callback) {
bind(subject, type, function(evt) {
if (evt.target.closest(selector)) {
if ((evt.target.closest ? evt.target : evt.target.parentNode).closest(selector)) {
callback.call(subject, evt);
}
});
Expand Down

0 comments on commit 6cdbb58

Please sign in to comment.