( doc: Document, overlayTag?: string, id?: string )
| 468 | * @returns The overlay element or `undefined` if no overlay element is found. |
| 469 | */ |
| 470 | export 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 |
no test coverage detected