Skip to content

Commit ed00cb6

Browse files
committed
prevent dragleave event triggered while user dragging over child items
1 parent 409bdeb commit ed00cb6

File tree

5 files changed

+49
-6
lines changed

5 files changed

+49
-6
lines changed

demo/public/index.js

Lines changed: 18 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/public/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/src/App.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<template>
22
<div>
3+
<a class="btn-back" href="https://github.com/d2phap/vue-file-selector" target="_blank">
4+
Back to Github
5+
</a>
6+
37
<file-selector
48
accept-extensions=".jpg,.svg"
59
:multiple="true"
@@ -114,7 +118,9 @@ html, body {
114118
}
115119
116120
body {
121+
margin: 0;
117122
padding: 2rem;
123+
padding-top: 0;
118124
119125
p {
120126
margin-top: 0;
@@ -126,6 +132,7 @@ body {
126132
}
127133
128134
.fs-file-selector {
135+
margin-top: 1rem;
129136
user-select: none;
130137
position: sticky !important;
131138
top: -2px;
@@ -175,7 +182,14 @@ body {
175182
}
176183
177184
178-
185+
.btn-back {
186+
display: inline-block;
187+
padding: 1rem 0;
188+
position: sticky;
189+
top: 1rem;
190+
z-index: 10;
191+
font-weight: 600;
192+
}
179193
180194
.section-top {
181195
margin-bottom: 2rem;
@@ -200,7 +214,7 @@ body {
200214
.gallery {
201215
margin-top: 2rem;
202216
display: grid;
203-
grid-template-columns: repeat(6, 1fr);
217+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
204218
grid-column-gap: 1rem;
205219
grid-row-gap: 1rem;
206220

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/component.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,18 @@ export default {
189189
height: 1px;
190190
}
191191
}
192+
193+
&.fs-drag-enter {
194+
// to prevent dragleave event triggered while user dragging over child items
195+
.fs-droppable::before {
196+
content: "";
197+
position: absolute;
198+
top: 0;
199+
bottom: 0;
200+
width: 100%;
201+
height: 100%;
202+
z-index: 9999999;
203+
}
204+
}
192205
}
193206
</style>

0 commit comments

Comments
 (0)