Skip to content

fix(modal): dismiss keyboard on drag card modal#30020

Closed
hedinasr wants to merge 1 commit intoionic-team:mainfrom
hedinasr:main
Closed

fix(modal): dismiss keyboard on drag card modal#30020
hedinasr wants to merge 1 commit intoionic-team:mainfrom
hedinasr:main

Conversation

@hedinasr
Copy link
Copy Markdown

Issue number: resolves #30019


What is the current behavior?

Dragging a card modal on iOS while the keyboard is open does not close the keyboard.

What is the new behavior?

Dragging a card modal closes the keyboard.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Before After
ScreenRecording_11-14-2024.13-51-10_1.mov
Simulator.Screen.Recording.-.iPhone.16.-.2024-11-14.at.14.54.03.mp4

@hedinasr hedinasr requested a review from a team as a code owner November 14, 2024 14:18
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 2:20pm

@aeharding
Copy link
Copy Markdown
Contributor

This is a breaking change for my use case, where users desire the keyboard to remain present.

A better solution would be adding onDragStart event to modal so developers can customize behavior - see: #23955 (comment)

@hedinasr
Copy link
Copy Markdown
Author

@aeharding actually, this is exactly the same behavior as the sheet modal; which closes the keyboard on drag. Can you show me an example of your use case?

@aeharding
Copy link
Copy Markdown
Contributor

@aeharding actually, this is exactly the same behavior as the sheet modal; which closes the keyboard on drag. Can you show me an example of your use case?

For example, iOS mail, if you pull down an email slightly the keyboard stays visible.

@hedinasr
Copy link
Copy Markdown
Author

hedinasr commented Nov 18, 2024

@aeharding do you think that we can add a prop to conditionally activate this feature? Like having a dimissKeyboard boolean prop? I can implement the feature here.

@brandyscarney brandyscarney requested a review from ShaneK July 1, 2025 21:38
@ShaneK
Copy link
Copy Markdown
Member

ShaneK commented Aug 1, 2025

Hey! Thanks for the PR! I think I do agree with @aeharding here that this may not be desired behavior. As he suggested on the linked issue (and here), I think we'd prefer an event be emitted on drag start/end so developers can rig up their own event handling to do what they want - in your case, dismiss the keyboard.

I wouldn't even be opposed to this just being an optional property to enable keyboard dismiss on drag, but I still think an event being emitted on drag events would be a much nicer way to go

@ShaneK ShaneK added the needs: reply the issue needs a response from the user label Aug 1, 2025
@aeharding
Copy link
Copy Markdown
Contributor

#23955 (comment) was solved so this MR can probably be closed! 🎉

@ionitron-bot ionitron-bot Bot added triage and removed needs: reply the issue needs a response from the user labels Mar 9, 2026
@ShaneK
Copy link
Copy Markdown
Member

ShaneK commented Mar 9, 2026

Thanks for bringing this back up @aeharding! This should be possible now in a way that should work for everyone with the drag events in 8.8.0, so I'm going to close this now

@ShaneK ShaneK closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug[ios]: open keyboard is not dismissed when card modal is dragged

3 participants