ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.13k stars 13.5k forks source link

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

Open hedinasr opened 1 week ago

hedinasr commented 1 week ago

Issue number: resolves https://github.com/ionic-team/ionic-framework/issues/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?

Other information

Before After
vercel[bot] commented 1 week ago

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 commented 1 week ago

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: https://github.com/ionic-team/ionic-framework/issues/23955#issuecomment-1821377765

hedinasr commented 1 week ago

@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 commented 1 week ago

@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 commented 1 week ago

@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.