ng2-idle icon indicating copy to clipboard operation
ng2-idle copied to clipboard

Fixing bug #34: Idle detection not consistent in IE11

Open wenz opened this issue 8 years ago • 7 comments

Fixes bug #34 by specifically excluding Internet Explorer

Please check if the PR fulfills these requirements

  • [X] The commit message follows our guidelines: https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#pr
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

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:

wenz avatar Nov 03 '17 11:11 wenz

Coverage Status

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

coveralls avatar Nov 03 '17 11:11 coveralls

@HackedByChinese could you pls merge this one?

henrysachs avatar Mar 14 '18 13:03 henrysachs

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 :(

grbsk avatar Mar 15 '18 05:03 grbsk

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 avatar Mar 15 '18 05:03 henrysachs

@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]);

henrysachs avatar Mar 22 '18 20:03 henrysachs

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?

rolshevskyj avatar May 15 '18 17:05 rolshevskyj

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.

mattmbrightside avatar May 11 '20 22:05 mattmbrightside