MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / initSwipeToClose

Method initSwipeToClose

core/src/components/modal/modal.tsx:729–763  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

727 }
728
729 private initSwipeToClose() {
730 if (getIonMode(this) !== 'ios') {
731 return;
732 }
733
734 const { el } = this;
735
736 // All of the elements needed for the swipe gesture
737 // should be in the DOM and referenced by now, except
738 // for the presenting el
739 const animationBuilder = this.leaveAnimation || config.get('modalLeave', iosLeaveAnimation);
740 const ani = (this.animation = animationBuilder(el, {
741 presentingEl: this.presentingElement,
742 expandToScroll: this.expandToScroll,
743 }));
744
745 const contentEl = findIonContent(el);
746 if (!contentEl) {
747 printIonContentErrorMsg(el);
748 return;
749 }
750
751 const statusBarStyle = this.statusBarStyle ?? StatusBarStyle.Default;
752
753 this.gesture = createSwipeToCloseGesture(
754 el,
755 ani,
756 statusBarStyle,
757 () => this.cardOnDismiss(),
758 () => this.onDragStart(),
759 (detail: ModalDragEventDetail) => this.onDragMove(detail),
760 (detail: ModalDragEventDetail) => this.onDragEnd(detail)
761 );
762 this.gesture.enable(true);
763 }
764
765 private initSheetGesture() {
766 const { wrapperEl, initialBreakpoint, backdropBreakpoint } = this;

Callers 2

presentMethod · 0.95
reinitSwipeToCloseMethod · 0.95

Calls 10

cardOnDismissMethod · 0.95
onDragStartMethod · 0.95
onDragMoveMethod · 0.95
onDragEndMethod · 0.95
getIonModeFunction · 0.90
findIonContentFunction · 0.90
printIonContentErrorMsgFunction · 0.90
getMethod · 0.65
enableMethod · 0.65

Tested by

no test coverage detected