* Call this whenever this object is about to become obsolete. * This makes the managed node focusable again and deletes all of the previously stored state.
()
| 272 | * This makes the managed node focusable again and deletes all of the previously stored state. |
| 273 | */ |
| 274 | destructor() { |
| 275 | this._throwIfDestroyed(); |
| 276 | |
| 277 | if (this._node) { |
| 278 | if (this.hasSavedTabIndex) |
| 279 | this._node.setAttribute('tabindex', this.savedTabIndex); |
| 280 | else |
| 281 | this._node.removeAttribute('tabindex'); |
| 282 | |
| 283 | // Use `delete` to restore native focus method. |
| 284 | if (this._overrodeFocusMethod) |
| 285 | delete this._node.focus; |
| 286 | } |
| 287 | this._node = null; |
| 288 | this._inertRoots = null; |
| 289 | |
| 290 | this._destroyed = true; |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * @type {boolean} Whether this object is obsolete because the managed node is no longer inert. |
no test coverage detected