ng-idle is not working in IE9 and IE10

ng-idle is not working in IE9 and IE10. Suppose if you leave the mouse pointer on the page, it is not considering as the user is inactive. When you keep the mouse pointer is outside of the page it is working.

Please provide solution for this.

Use following url to check http://hackedbychinese.github.io/ng-idle/

Upvotes: 3

Views: 905

Answers (2)

Replace

$document.find('body').on(options.interrupt, function(event) {
    svc.interrupt();
}

with the following code in angular-idle.js

$document.find('body').on(options.interrupt, function(event) {
    if (event.type !== 'mousemove' || (event.movementX || event.movementY)) {
        svc.interrupt();
    }
});

Upvotes: 2

Rudra
Rudra

Reputation: 1688

It seems the issue is with the mousemove event, the quick fix for it can be the removal of mousemove event for the IE browser. Write a conditional statement using useragent and use interrupt() method of ng-idle to configure events.

if (navigator.userAgent.toLowerCase().indexOf("msie") > 0) {
            // Code for Internet Explorer because ng-idle doesn't stop listening mousemove event.
            IdleProvider.interrupt('keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll'); 
        }
        else {
            IdleProvider.interrupt('mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll'); 
        } 

Upvotes: 1

Related Questions