vue-final-modal
vue-final-modal copied to clipboard
Closing a dynamic modal throws error: enableBodyScroll unsuccessful
In the browser console, closing a dynamic modal always throws the error:
enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS device
Environment: Vue3 - globally registered vue-final-modal so calling this.$vfm.show works everywhere Chrome
The dynamic modal component (MyDialog) is just a vanilla component with just HTML in the template text:
<template>
<div>HELO WERLD</div>
</template>
The modal is opened with: this.$vfm.show({component:MyDialog})
Closing is done by clicking on the coverall background.
+1
I get the same error when I close the modal window and go to another route (the view in which the modal window was destroyed). If I add a delay of 300 ms before the transition, there is no error.
+1
+1
@Iviyan
$vfm.hideAll()
returns a promise, if you wait for the promise to resolve before switching routes you won't get this error.
https://vue-final-modal.org/api#vfmhideall