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

Function getPresentedOverlay

core/src/utils/overlays.ts:470–479  ·  view source on GitHub ↗
(
  doc: Document,
  overlayTag?: string,
  id?: string
)

Source from the content-addressed store, hash-verified

468 * @returns The overlay element or `undefined` if no overlay element is found.
469 */
470export const getPresentedOverlay = (
471 doc: Document,
472 overlayTag?: string,
473 id?: string
474): HTMLIonOverlayElement | undefined => {
475 const overlays = getPresentedOverlays(doc, overlayTag);
476 // If no id is provided, return the last presented overlay
477 // Otherwise, return the last overlay with the given id
478 return (id === undefined ? overlays : overlays.filter((o: HTMLIonOverlayElement) => o.id === id)).slice(-1)[0];
479};
480
481/**
482 * When an overlay is presented, the main

Callers 5

MenuClass · 0.90
getTopFunction · 0.85
trapKeyboardFocusFunction · 0.85
connectListenersFunction · 0.85
dismissOverlayFunction · 0.85

Calls 1

getPresentedOverlaysFunction · 0.85

Tested by

no test coverage detected