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: inline modal/popover framework integrations should automatically dismiss before unmount #23567
The BaseModal component wraps the actual ion-modal component, setting is-open always to true. So the outer v-if decides if the modal gets rendered or not.
In v5 setting showModal to false triggered the close animation. In v6.beta-0 the modal disappears immediately.
Behavior in v5:
v5-modal.mov
Behavior in v6:
v6-modal.mov
Expected behavior:
The close animation should be triggered if the Modal gets deactivated via v-if
Thanks for the issue. With v6 we are trying to move as much of the inline modal logic inside of ion-modal itself and away from the framework-specific wrappers.
The framework-specific wrappers automatically call dismiss in onVnodeBeforeUnmount which is something that got removed in v6, but I think we should still keep this functionality.
changed the title [-]bug: ion-modal close animation does not work anymore if modal is wrapped in v-if[/-][+]bug: inline modal/popover framework integrations should automatically dismiss before unmount[/+]on Jul 6, 2021
@liamdebeasi: I'm wondering if there is any workaround to this? I've tried dismissing the modal manually in the vnode-before-unmount hook of my BaseModal component, but that doesn't seem to work correctly.
Would be happy for any guidance, as this is blocking us from upgrading to v6.
Thank you for submitting the issue! The team has investigated this further. If an overlay is unmounted via a conditional rendering then the dismiss animation will not occur.
If you want to have the dismiss animation, then it is recommended to call the dismiss function before unmounting.
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, 2021
Thanks for the issue. With v6 we are trying to move as much of the inline modal logic inside of
ion-modalitself and away from the framework-specific wrappers.The framework-specific wrappers automatically call dismiss in
onVnodeBeforeUnmountwhich is something that got removed in v6, but I think we should still keep this functionality.For context, here is what the modal wrappers look like in v5: https://github.com/ionic-team/ionic-framework/blob/master/packages/vue/src/vue-component-lib/overlays.ts
And here is what modal looks like in v6: https://github.com/ionic-team/ionic-framework/blob/next/packages/vue/src/components/IonModal.ts. I think we could add
onVnodeBeforeUnmounthere to preserve this dismiss behavior.edit: This behavior should probably be extended to Angular and React as well.
[-]bug: ion-modal close animation does not work anymore if modal is wrapped in v-if[/-][+]bug: inline modal/popover framework integrations should automatically dismiss before unmount[/+]tho-masn commentedon Dec 9, 2021
@liamdebeasi: I'm wondering if there is any workaround to this? I've tried dismissing the modal manually in the
vnode-before-unmounthook of myBaseModalcomponent, but that doesn't seem to work correctly.Would be happy for any guidance, as this is blocking us from upgrading to v6.
liamdebeasi commentedon Dec 9, 2021
You might be able to integrate with Vue Enter and Leave Transitions. This is likely what we will implement internally.
thetaPC commentedon May 5, 2023
Thank you for submitting the issue! The team has investigated this further. If an overlay is unmounted via a conditional rendering then the dismiss animation will not occur.
If you want to have the dismiss animation, then it is recommended to call the
dismissfunction before unmounting.async dismiss() { await this.$refs.modal.$el.dismiss(); this.showModal = false; },ionitron-bot commentedon Jun 4, 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.