vue-final-modal icon indicating copy to clipboard operation
vue-final-modal copied to clipboard

Closing a dynamic modal throws error: enableBodyScroll unsuccessful

Open jifka opened this issue 3 years ago • 4 comments

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.

jifka avatar Feb 12 '22 20:02 jifka

+1

pommedepain avatar Jul 22 '22 09:07 pommedepain

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.

Iviyan avatar Aug 09 '22 11:08 Iviyan

+1

AnatoliiDev avatar Sep 21 '22 18:09 AnatoliiDev

+1

Shade465 avatar Sep 22 '22 18:09 Shade465

@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

nmarsh92 avatar Oct 03 '22 16:10 nmarsh92