Skip to content

Commit

Permalink
destructor should keep already inert elements still inert
Browse files Browse the repository at this point in the history
  • Loading branch information
valdrinkoshi committed Aug 11, 2016
1 parent e4d46d5 commit 1a33482
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blocking-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
*/
destructor() {
// Pretend like top changed from current top to null in order to reset
// all its parents `inert`.
BlockingElements[_topChanged](null, this.top);
// all its parents inertness. Ensure we keep inert what was already inert!
BlockingElements[_topChanged](null, this[_topElement], this[_alreadyInertElements]);
this[_topElement] = null;
this[_blockingElements] = null;
this[_alreadyInertElements] = null;
Expand Down Expand Up @@ -124,7 +124,7 @@
*/
pop() {
const top = this.top;
this.remove(top);
top && this.remove(top);
return top;
}

Expand Down

0 comments on commit 1a33482

Please sign in to comment.