MCPcopy
hub / github.com/GoogleChromeLabs/ui-element-samples / destructor

Method destructor

3d-card-flip/inert.js:274–291  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

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.

Callers 1

removeInertRootMethod · 0.95

Calls 1

_throwIfDestroyedMethod · 0.95

Tested by

no test coverage detected