Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
Fix event removal for platforms (e.g. old Chrome) that don't have eve…
Browse files Browse the repository at this point in the history
…nt options.
  • Loading branch information
Steven Orvell committed Apr 11, 2019
1 parent 9fa8f8a commit 5d9f909
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/patch-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export function addEventListener(type, fnOrObj, optionsOrCapture) {
const wrapperFn = function(e) {
// Support `once` option.
if (once) {
this[utils.SHADY_PREFIX + 'removeEventListener'](type, fnOrObj, nativeEventOptions);
this[utils.SHADY_PREFIX + 'removeEventListener'](type, fnOrObj, optionsOrCapture);
}
if (!e['__target']) {
patchEvent(e);
Expand Down

1 comment on commit 5d9f909

@wessberg
Copy link

@wessberg wessberg commented on 5d9f909 Apr 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there. I was wondering about this change. In commit 563e10d you changed this very line to use nativeEventOptions rather than optionsOrCapture, but it seems you are now reverting this change. Can you elaborate? :-)

optionsOrCapture may be a dict, and passing it to browsers that don't support EventListenerOptions is loosely equal to true which forces the call to removeEventListener to useCapture

Please sign in to comment.