diff --git a/core/src/components/modal/gestures/swipe-to-close.ts b/core/src/components/modal/gestures/swipe-to-close.ts index 17ec454ff15..3b4c72efc3d 100644 --- a/core/src/components/modal/gestures/swipe-to-close.ts +++ b/core/src/components/modal/gestures/swipe-to-close.ts @@ -1,7 +1,7 @@ import { getTimeGivenProgression } from '@utils/animation/cubic-bezier'; import { isIonContent, findClosestIonContent, disableContentScrollY, resetContentScrollY } from '@utils/content'; import { createGesture } from '@utils/gesture'; -import { clamp, getElementRoot } from '@utils/helpers'; +import { clamp, getElementRoot, raf } from '@utils/helpers'; import { OVERLAY_GESTURE_PRIORITY } from '@utils/overlays'; import type { Animation } from '../../../interface'; @@ -141,6 +141,14 @@ export const createSwipeToCloseGesture = ( disableContentScrollY(contentEl); } + raf(() => { + /** + * Dismisses the open keyboard when the card drag gesture is started. + * Sets the focus onto the modal element. + */ + el.focus(); + }); + animation.progressStart(true, isOpen ? 1 : 0); };