-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Enhancement] Modal: Alert before close #376
Comments
moving to after release 1 for now - might reconsider if it highly needed by more teams than (team2?) - also workarounds might be possible? |
I would like to suggest that presentation of the alert depends on a condition. For instance, only show an alert when something is typed in an input field within the component. |
@hafstad det er ikke lavet endnu eller? |
This issue will be closed due to backlog prioritization and pruning. |
@alxzak can this issue be reopened? We need it in team 3 :) |
With the updated modal behavior, where you can drag to close on the entire modal dialog, it is even more important to have this "Alert before close" functionality. (The new modal behavior comes with the Ionic 6 upgrade) |
Ionic 6 provides a way to prevent a modal from being dismissed, by passing in a boolean or a callback that returns a boolean. https://ionicframework.com/docs/api/modal#setting-a-callback-function. We can utilize the Here is a working POC that is based on the example in the Ionic documentation: modal.helper.ts
We could follow this approach and make it possible for the developers to pass in an alert config instead of the hardcoded actionsheet. |
It should be possible to add an (optional) alert configuration when calling
modalController.showModal(config)
and opening the modal window.The alert should be shown when dismissing the modal (clicking the close button or esc key) and depending on the user interaction (true/false) the modal dismisses or not.
Note: If there is no hook for cancelling the dismissal (e.g.
onModalWillDismiss => true/false
) then we should limit the dismiss to the close button and handle the alert before callingmodalController.hideTopMost()
The text was updated successfully, but these errors were encountered: