Skip to content

Commit

Permalink
event-handler.js: use for...of
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jan 29, 2022
1 parent 62d86c0 commit b5147ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/src/dom/event-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ function bootstrapDelegationHandler(element, selector, fn) {
const domElements = element.querySelectorAll(selector)

for (let { target } = event; target && target !== this; target = target.parentNode) {
for (let i = domElements.length; i--;) {
if (domElements[i] === target) {
for (const domElement of domElements) {
if (domElement === target) {
event.delegateTarget = target

if (handler.oneOff) {
Expand Down

0 comments on commit b5147ec

Please sign in to comment.