-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bug: canDismiss
option doesn't work when used in modal controller
#27753
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
Comments
Thanks for the report. Ionic seems to be working as intended here. Your modal does not have a gesture, so swiping to dismiss the modal should not do anything. Pressing the "Escape" key does dismiss the modal, which would indicate |
Hi @liamdebeasi, thanks for a response. Could you share what should be done in the example to allow dismissing modal with a gesture? According to the documentation, this should be the default behaviour - it says that you can prevent dismissing modal by gesture by excluding 'gesture' role.
|
The swiping only applies to card or sheet modals, and the demo at that link uses a card modal. I opened ionic-team/ionic-docs#3021 to clarify this on the docs. |
There was some confusion around swipe gestures + modals on ionic-team/ionic-framework#27753. Developer thought the swipe gesture applied to all modals, but it only applies to card and sheet modals.
Thanks! |
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. |
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
Using this code:
opens a modal that is not dismissable.
Expected Behavior
Modal should be dismissable, as
canDismiss
option has been set to true.Steps to Reproduce
Code Reproduction URL
https://stackblitz.com/edit/angular-1akhtj-j7fysu?file=src%2Fapp%2Fexample.component.ts
Ionic Info
Additional Information
This feature appears to be working fine, when using inline
<ion-modal>
element. OnlyModalController
is affected. Example in the documentation using<ion-modal>
approach is fine: https://stackblitz.com/edit/angular-qwjldx?file=src%2Fapp%2Fexample.component.htmlThe text was updated successfully, but these errors were encountered: