You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: canDismiss option doesn't work when used in modal controller #27753
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 canDismiss is working correctly.
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.
Developers may want to prevent users from swiping to close a modal. This can be done by setting a callback function for canDismiss and checking if the role is not gesture.
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.
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.
Activity
liamdebeasi commentedon Jul 6, 2023
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
canDismissis working correctly.bbonczek commentedon Jul 7, 2023
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.
Developers may want to prevent users from swiping to close a modal. This can be done by setting a callback function for canDismiss and checking if the role is not gesture.liamdebeasi commentedon Jul 7, 2023
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.
docs(modal): clarify swipe to close section
bbonczek commentedon Jul 10, 2023
Thanks!
ionitron-bot commentedon Aug 9, 2023
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.