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

DOM refreshes and changes interactive elements back to "default" #56

Open martindevnow opened 7 years ago

martindevnow 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 have a component like this:

<div *ngFor="let item of items">
  <item-main [item]="item"></item-main>
  <item-expanded *ngIf="item.expanded" [item]="item"></item-expanded>
</div>

Clicking on <item-main> toggles the view of <item-expanded> This works.

However, after I click on <item-main>, 5000ms later, the IDLE_START event is dispatched and the DOM updates and the <item-expanded> disappears. (however, item.expanded is still set to true...)

Expected behavior Clicking on <item-main> toggles the view of <item-expanded> and it should not disappear after 5000ms

Minimal reproduction of the problem with instructions

Our package.json is:

    "@ng-idle/core": "2.0.0-beta.4",
    "@ng-idle/keepalive": "2.0.0-beta.4",

What is the motivation / use case for changing the behavior?

I don't know why the UI changes even though the core object used by ngIf doesn't change...

Please tell us about your environment:

Running on mac NPM = 4.1.2 NODE = 7.5.0 Angular = 2.2.4