Skip to content

Commit

Permalink
restore original attachShadow/createShadowRoot on destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
valdrinkoshi committed Oct 27, 2016
1 parent aec61f1 commit c600fc2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions inert.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const _focusableElementsString = ['a[href]',
*/
class InertRoot {
/**
* @param {Element} rootElement The Element at the root of the inert subtree.
* @param {InertManager} inertManager The global singleton InertManager object.
* @param {!Element} rootElement The Element at the root of the inert subtree.
* @param {!InertManager} inertManager The global singleton InertManager object.
*/
constructor(rootElement, inertManager) {
/** @type {InertManager} */
Expand Down Expand Up @@ -123,8 +123,10 @@ class InertRoot {
this._rootObserver.disconnect();
this._rootObserver = null;

if (this._rootElement)
this._rootElement.removeAttribute('aria-hidden');
this._rootElement.removeAttribute('aria-hidden');
// Restore original attachShadow and createShadowRoot.
delete this._rootElement.attachShadow;
delete this._rootElement.createShadowRoot;
this._rootElement = null;

for (let inertNode of this._managedNodes)
Expand Down

0 comments on commit c600fc2

Please sign in to comment.