Skip to content

Commit 734b5be

Browse files
author
Hedi Nasr
committed
fix(modal): dismiss keyboard on drag card modal
1 parent 3216108 commit 734b5be

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/components/modal/gestures/swipe-to-close.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getTimeGivenProgression } from '@utils/animation/cubic-bezier';
22
import { isIonContent, findClosestIonContent, disableContentScrollY, resetContentScrollY } from '@utils/content';
33
import { createGesture } from '@utils/gesture';
4-
import { clamp, getElementRoot } from '@utils/helpers';
4+
import { clamp, getElementRoot, raf } from '@utils/helpers';
55
import { OVERLAY_GESTURE_PRIORITY } from '@utils/overlays';
66

77
import type { Animation } from '../../../interface';
@@ -141,6 +141,14 @@ export const createSwipeToCloseGesture = (
141141
disableContentScrollY(contentEl);
142142
}
143143

144+
raf(() => {
145+
/**
146+
* Dismisses the open keyboard when the card drag gesture is started.
147+
* Sets the focus onto the modal element.
148+
*/
149+
el.focus();
150+
});
151+
144152
animation.progressStart(true, isOpen ? 1 : 0);
145153
};
146154

0 commit comments

Comments
 (0)