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

Function overlayAnimation

core/src/utils/overlays.ts:773–804  ·  view source on GitHub ↗
(
  overlay: OverlayInterface,
  animationBuilder: AnimationBuilder,
  baseEl: any,
  opts: any
)

Source from the content-addressed store, hash-verified

771};
772
773const overlayAnimation = async (
774 overlay: OverlayInterface,
775 animationBuilder: AnimationBuilder,
776 baseEl: any,
777 opts: any
778): Promise<boolean> => {
779 // Make overlay visible in case it's hidden
780 baseEl.classList.remove('overlay-hidden');
781
782 const aniRoot = overlay.el;
783 const animation = animationBuilder(aniRoot, opts);
784
785 if (!overlay.animated || !config.getBoolean('animated', true)) {
786 animation.duration(0);
787 }
788
789 if (overlay.keyboardClose) {
790 animation.beforeAddWrite(() => {
791 const activeElement = baseEl.ownerDocument!.activeElement as HTMLElement;
792 if (activeElement?.matches('input,ion-input, ion-textarea')) {
793 activeElement.blur();
794 }
795 });
796 }
797
798 const activeAni = activeAnimations.get(overlay) || [];
799 activeAnimations.set(overlay, [...activeAni, animation]);
800
801 await animation.play();
802
803 return true;
804};
805
806export const eventMethod = <T>(element: HTMLElement, eventName: string): Promise<T> => {
807 let resolve: (detail: T) => void;

Callers 2

presentFunction · 0.85
dismissFunction · 0.85

Calls 6

durationMethod · 0.80
beforeAddWriteMethod · 0.80
setMethod · 0.80
playMethod · 0.80
getMethod · 0.65
getBooleanMethod · 0.45

Tested by

no test coverage detected