Skip to content

Conversation

ul8
Copy link
Contributor

@ul8 ul8 commented Dec 3, 2020

Fix issue where stopping all event propagation in modal container interferes with opening the choices.js modal, which has event listeners on document.

Sandbox with original issue: https://codesandbox.io/s/vue-final-modal-choices-js-issue-5o694?file=/src/components/VModal.vue (choices.js works fine outside the modal, but not inside the modal, where it does not open on click)

My solution: Instead of stopping all event propagation in the modal content, I'm using the .self modifier on the container to only capture direct clicks on it. I stole this from vue-js-modal code. They use a .self.stop modifier, but I'm not sure why the stop would be necessary here.
https://github.com/euvl/vue-js-modal/blob/2682950e4f9ad37b50d0c4bff0a009856df0be9a/src/components/Modal.vue#L15

Please note that I only tested this with a narrow set of configuration options for vue-final-modal as I am not that deep into your code.

fix issue where stopping all event propagation in modal container interferes with opening the choices.js modal, which has event listeners on document
@hunterliu1003
Copy link
Member

Many thanks for spending time to solve this issue.
I tested your commit, and it seems all right.
I thought adding .self at vfmContainer and removing .stop at vfmContent is more precise and flexible.

I would merge this PR and publish a bugfix version both in Vue 2 and Vue 3.

@hunterliu1003 hunterliu1003 merged commit 2f0c751 into vue-final:master Dec 3, 2020
@hunterliu1003
Copy link
Member

Hi @ul8,

The fix is published in:

  • 0.19.3 for Vue 2
  • 1.6.2 for Vue 3

@hunterliu1003 hunterliu1003 mentioned this pull request Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants