moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

DocumentInterruptSource issue with scroll event #30

Open sammichelson opened 7 years ago

sammichelson commented 7 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help

Current behavior I noticed when using my own DocumentInterruptSource instance that the scroll event doesn't trigger for document.documentElement.

However document.onscroll and window.onscroll work as expected so I'm using WindowInterruptSource for now.

Expected behavior DocumentInterruptSource events should work for document event listeners

Minimal reproduction of the problem with instructions in the browser console if you type and enter: document.documentElement.onscroll = function() { console.log('scroll')} and scroll, nothing happens.

My interrupt sources are:

let interruptSources: DocumentInterruptSource[] = [new DocumentInterruptSource( 'mousemove keydown mousedown touchstart touchmove scroll')];

What is the motivation / use case for changing the behavior? The default interrupts use DocumentInterruptSource.

Please tell us about your environment: MacOSX Chrome 55

juri33 commented 6 years ago

+1

Khushi079 commented 2 months ago

I am also facing same issue, is there any solution provided for this issue yet? I event tried new EventTargetInterruptSource(document, 'scroll'), scroll is not reflecting on components that are being used under <router-outlet>