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
I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
The canDismiss handler for ion-modal should accept an argument for role.
canDismiss(role?: string): boolean;
Describe the Use Case
With swipeToClose being deprecated and removed in the near future, developers will need to migrate their implementation to use canDismiss. canDismiss while similar to the behavior of swipeToClose, behaves differently and can require additional code for developers.
For example, if a user is presenting a card modal, but wants to disable swiping to dismiss the overlay they will need to set canDismiss to false. But when a button is clicked to dismiss the overlay, developers will now need to set canDismiss to true. This requires an additional property in the implementation to keep track of the state of canDismiss. Prior to the deprecation of swipeToClose, developers would just set swipeToClose to false and when dismissing the overlay, the overlay would dismiss without any additional action required by the developer.
Describe Preferred Solution
<ion-modal[canDismiss]="canDismiss"></ion-modal>
canDismiss=(role?: string)=>{// roles tied to clicking a "Confirm" button or "Cancel" button.returnrole==='confirm'||role==='cancel';}
Describe Alternatives
No response
Related Code
No response
Additional Information
This feature was split from discussion started here: #26173 (comment)
The text was updated successfully, but these errors were encountered:
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.
Prerequisites
Describe the Feature Request
The
canDismiss
handler forion-modal
should accept an argument forrole
.Describe the Use Case
With
swipeToClose
being deprecated and removed in the near future, developers will need to migrate their implementation to usecanDismiss
.canDismiss
while similar to the behavior ofswipeToClose
, behaves differently and can require additional code for developers.For example, if a user is presenting a card modal, but wants to disable swiping to dismiss the overlay they will need to set
canDismiss
tofalse
. But when a button is clicked to dismiss the overlay, developers will now need to setcanDismiss
totrue
. This requires an additional property in the implementation to keep track of the state ofcanDismiss
. Prior to the deprecation ofswipeToClose
, developers would just setswipeToClose
tofalse
and when dismissing the overlay, the overlay would dismiss without any additional action required by the developer.Describe Preferred Solution
Describe Alternatives
No response
Related Code
No response
Additional Information
This feature was split from discussion started here: #26173 (comment)
The text was updated successfully, but these errors were encountered: