MCPcopy Create free account
hub / github.com/UI5/webcomponents / disconnectedCallback

Function disconnectedCallback

packages/base/src/UI5Element.ts:398–417  ·  view source on GitHub ↗

* Do not call this method from derivatives of UI5Element, use "onExitDOM" only * @private

()

Source from the content-addressed store, hash-verified

396 * @private
397 */
398 disconnectedCallback() {
399 const ctor = this.constructor as typeof UI5Element;
400 const slotsAreManaged = ctor.getMetadata().slotsAreManaged();
401
402 this._inDOM = false;
403
404 if (slotsAreManaged) {
405 this._stopObservingDOMChildren();
406 }
407
408 if (this._fullyConnected) {
409 this.onExitDOM();
410 this._fullyConnected = false;
411 }
412
413 this._domRefReadyPromise._deferredResolve!();
414
415 cancelRender(this);
416 unregisterElement(this);
417 }
418
419 /**
420 * Called every time before the component renders.

Callers

nothing calls this directly

Calls 5

cancelRenderFunction · 0.85
unregisterElementFunction · 0.85
slotsAreManagedMethod · 0.80
getMetadataMethod · 0.80
onExitDOMMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…