MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / getDelegate

Function getDelegate

core/src/utils/overlays.ts:884–906  ·  view source on GitHub ↗
(force = false)

Source from the content-addressed store, hash-verified

882 * @returns The delegate to use and whether or not the overlay is inline.
883 */
884 const getDelegate = (force = false) => {
885 if (workingDelegate && !force) {
886 return {
887 delegate: workingDelegate,
888 inline,
889 };
890 }
891 const { el, hasController, delegate } = ref;
892 /**
893 * If using overlay inline
894 * we potentially need to use the coreDelegate
895 * so that this works in vanilla JS apps.
896 * If a developer has presented this component
897 * via a controller, then we can assume
898 * the component is already in the
899 * correct place.
900 */
901 const parentEl = el.parentNode as HTMLElement | null;
902 inline = parentEl !== null && !hasController;
903 workingDelegate = inline ? delegate || coreDelegate : delegate;
904
905 return { inline, delegate: workingDelegate };
906 };
907
908 /**
909 * Attaches a component in the DOM. Teleports the component

Callers 2

attachViewToDomFunction · 0.85
removeViewFromDomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected