browser-interaction-time icon indicating copy to clipboard operation
browser-interaction-time copied to clipboard

fix: remove event listeners for throttled events

Open DanAndreasson opened this issue 3 years ago • 1 comments

  1. When removing event listeners, refer to the new function created by throttle instead of the original unthrottled function
  2. Pass in the document/window listener options to removeEventListener. From https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener

Warning: If a listener is registered twice, one with the capture flag set and one without, you must remove each one separately. Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.

  1. Don't try to go into idle mode if already idle
  2. Add extraDocumentIdleEvents. I'm dispatching a CustomEvent which I want to treat as the user is active

DanAndreasson avatar Feb 03 '22 14:02 DanAndreasson

Hooray! All contributors have signed the CLA.

atlassian-cla-bot[bot] avatar Feb 03 '22 14:02 atlassian-cla-bot[bot]