Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/VueFinalModal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.umd.js.map

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions lib/VueFinalModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@
role="dialog"
aria-modal="true"
tabindex="-1"
@click.self="onClickContainer"
@mouseup.self.stop="onMouseupContainer"
@touchend.self.stop="onMouseupContainer"
@mousedown.self.stop="onMousedown"
@touchstart.self.stop="onMousedown"
>
<div
ref="vfmContent"
class="vfm__content"
:class="[contentClass, { 'vfm--prevent-auto': preventClick }]"
:style="bindContentStyle"
@mousedown.self.stop="onMousedown"
@touchstart.self.stop="onMousedown"
>
<slot :params="params" :close="() => $emit('input', false)" />
<div
Expand Down Expand Up @@ -178,7 +183,8 @@ export default {
dragResizeStyle: {},
resolveToggle: noop,
rejectToggle: noop,
state: null
state: null,
lastMousedownEl: null
}),
computed: {
api() {
Expand Down Expand Up @@ -430,7 +436,12 @@ export default {
if (stopEvent) return
this.params = {}
},
onClickContainer() {
onMousedown(e) {
this.lastMousedownEl = e.target
},
onMouseupContainer(e) {
// skip when the mousedown didn't start on the container el
if (this.lastMousedownEl !== e.target) return
// skip when state equal 'resize:move'
if (this.state === 'resize:move') return
this.$emit('click-outside', this.createModalEvent({ type: 'click-outside' }))
Expand Down