moribvndvs / ng2-idle

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

Fixing bug #34: Idle detection not consistent in IE11 #67

Closed wenz closed 3 months ago

wenz commented 6 years ago

Fixes bug #34 by specifically excluding Internet Explorer

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here) https://github.com/HackedByChinese/ng2-idle/issues/34

What is the new behavior? Works in IE11

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 99.36% when pulling b4d841077ec81a98adae3a48e0d9c180d534043f on wenz:patch-1 into a5e24eb58cc66a7dc251e602d7cbd7616be0c1aa on HackedByChinese:master.

henrysachs commented 6 years ago

@HackedByChinese could you pls merge this one?

moribvndvs commented 6 years ago

I'm nervous the default behavior for filterEvent is a kludgy mess when it comes to dealing with the user moving the mouse, and I fear user agent detection can make it worse. This needs to be greatly simplified because it's caused other problems in the past. However, I've kind of lost track of all the original bugs that lead to this code :(

henrysachs commented 6 years ago

Yeah but take a Look into his branch its just a line of Code. I tried it in my current project and it worked like a charm. Would be very happy to have this merge. But could you elaborate further why this would be a bad idea? Maybe i didnt had these edge cases.

henrysachs commented 6 years ago

@all having this problem while the Pull Request isn't merged consider using the pointermove event which is supported in IE11 and triggers the reset. Therefore you need to create your own DocumentIntruptsources Object and register all events as seen below. This should anyway be the way to go instead of using DEFAULT interuptsources (imo). Code could look like this

const interuptsources = new DocumentInterruptSource("click keydown mousemove pointermove");
this.idle.setInterrupts([interuptsources]);
rolshevskyj commented 6 years ago

adding pointermove doesn't work for me. Having issues with mouse move in Chrome: the timer of the timeout warning stops, but the warning stays. When this expected to be checked in?

mattmbrightside commented 4 years ago

Tested today with IE11 in a VM; it detects the click and keydown to stop the idle warning. But it does not detect mouse movement, I still get the idle warning if I only move the mouse and do not click or press keys.