Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: canLeave event for overlays #22297

Closed
EinfachHans opened this issue Oct 12, 2020 · 9 comments
Closed

feat: canLeave event for overlays #22297

EinfachHans opened this issue Oct 12, 2020 · 9 comments
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement

Comments

@EinfachHans
Copy link
Contributor

Feature Request

Ionic version:

[x] 5.x

Describe the Feature Request

I want to add a CanLeave() Event on Overlays (mainly iOS card Style modal, but also for upcoming drawer) which should be somehow triggered while swiping. See attached Video of how native Web.de Mail-App handles this:

If nothing was typed in, i can just swipe to close the modal. If i did, the swipe doesn't go to the end and shows a Action Sheet after i released.

Describe Preferred Solution

I think this should automatically work if a CanDismiss Callback is set to the Modal Element. This should be able to parse a boolean, or better a Promise or even better both.

@ionitron-bot ionitron-bot bot added the triage label Oct 12, 2020
@BerkeAras
Copy link

@EinfachHans Good idea, but isn't it possible to something like that with ionModalWillDismiss

@EinfachHans
Copy link
Contributor Author

@BerkeAras it doesn't change the animation and i think i'm not able to "cancel" the dismissing here

@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report type: feature request a new feature, enhancement, or improvement and removed type: bug a confirmed bug report labels Oct 12, 2020
@ionitron-bot ionitron-bot bot removed the triage label Oct 12, 2020
@BerkeAras
Copy link

@EinfachHans event.preventDefault does not work?

@EinfachHans
Copy link
Contributor Author

You don't have a event here and even if you have this won't be async and more a workaround then a solution @BerkeAras

@roman-rr
Copy link

@EinfachHans

You don't have a event here and even if you have this won't be async and more a workaround then a solution @BerkeAras

Ok I see. Slower drag if dismiss not allowed. And preventDismiss(true/false)
Please make new feature request.

@liamdebeasi liamdebeasi changed the title feat: CanLeave Event for Overlays that closes via swipe feat: canLeave event for overlays Dec 4, 2020
@liamdebeasi
Copy link
Contributor

Merged #22626 into this issue. I think this is an interesting feature and can see this being useful for modals in general, not just card-style modals.

@EinfachHans
Copy link
Contributor Author

EinfachHans commented Dec 4, 2020

@liamdebeasi My PR is for normal Modals as well 😃

liamdebeasi added a commit that referenced this issue Mar 11, 2022
resolves #22297

Co-authored-by: EinfachHans <EinfachHans@users.noreply.github.com>
@liamdebeasi
Copy link
Contributor

liamdebeasi commented Mar 11, 2022

Thanks for the issue. This has been resolved via #24928, and this feature will be available in an upcoming release of Ionic Framework.

@ionitron-bot
Copy link

ionitron-bot bot commented Apr 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants