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

Function prepareOverlay

core/src/utils/overlays.ts:87–107  ·  view source on GitHub ↗
(el: T)

Source from the content-addressed store, hash-verified

85 * Prepares the overlay element to be presented.
86 */
87export const prepareOverlay = <T extends HTMLIonOverlayElement>(el: T) => {
88 if (typeof document !== 'undefined') {
89 /**
90 * Adds a single instance of event listeners for application behaviors:
91 *
92 * - Escape Key behavior to dismiss an overlay
93 * - Trapping focus within an overlay
94 * - Back button behavior to dismiss an overlay
95 *
96 * This only occurs when the first overlay is created.
97 */
98 connectListeners(document);
99 }
100 const overlayIndex = lastOverlayIndex++;
101 /**
102 * overlayIndex is used in the overlay components to set a zIndex.
103 * This ensures that the most recently presented overlay will be
104 * on top.
105 */
106 el.overlayIndex = overlayIndex;
107};
108
109/**
110 * Assigns an incrementing id to an overlay element, that does not

Callers 7

connectedCallbackMethod · 0.90
connectedCallbackMethod · 0.90
connectedCallbackMethod · 0.90
connectedCallbackMethod · 0.90
connectedCallbackMethod · 0.90
connectedCallbackMethod · 0.90
connectedCallbackMethod · 0.90

Calls 1

connectListenersFunction · 0.85

Tested by

no test coverage detected