Issue Task Closed

#91084Pass targetElement explicitly for RegularEvent.delegateTo

Oliver Hader 04/17/20, 12:24 updated 04/21/20, 10:43

Description

new RegularEvent('click', (evt) => {
  console.log(this, this instanceof HTMLElement);
}).delegateTo(document, 'a[data-action="toggle"]');

this won’t contain the expected HTMLElement (as assigned a thisArg when invoking the callback)

Reviews 1