Skip to content

Commit 79fb9ce

Browse files
authored
Merge pull request #1912 from shentao/v3-3-1
release v3.3.1
2 parents e0d3b48 + c6e95d3 commit 79fb9ce

32 files changed

+184
-103
lines changed

dist/vue-multiselect.common.js

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

dist/vue-multiselect.common.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.

dist/vue-multiselect.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
border-top: none;
278278
border-bottom-left-radius: 5px;
279279
border-bottom-right-radius: 5px;
280-
z-index: 9999;
280+
z-index: 50;
281281
-webkit-overflow-scrolling: touch;
282282
}
283283

dist/vue-multiselect.esm.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
border-top: none;
278278
border-bottom-left-radius: 5px;
279279
border-bottom-right-radius: 5px;
280-
z-index: 9999;
280+
z-index: 50;
281281
-webkit-overflow-scrolling: touch;
282282
}
283283

dist/vue-multiselect.esm.js

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,15 @@ var script = {
10731073
required: {
10741074
type: Boolean,
10751075
default: false
1076+
},
1077+
/**
1078+
* Uses Vue Teleport's feature. Teleports the open dropdown to the bottom of the body element
1079+
* @default false
1080+
* @type {Boolean}
1081+
*/
1082+
useTeleport: {
1083+
type: Boolean,
1084+
default: false
10761085
}
10771086
},
10781087
data () {
@@ -1165,18 +1174,23 @@ var script = {
11651174
watch: {
11661175
isOpen (val) {
11671176
if (val) {
1168-
this.ready = false;
1169-
this.$nextTick(() => {
1170-
const rect = this.$el.getBoundingClientRect();
1171-
this.dropdownStyles = {
1172-
position: 'absolute',
1173-
top: `${rect.bottom + window.scrollY}px`,
1174-
left: `${rect.left + window.scrollX}px`,
1175-
width: `${rect.width}px`,
1176-
zIndex: 9999
1177-
};
1177+
if (this.useTeleport) {
1178+
this.ready = false;
1179+
// This helps with the positioning of the open dropdown when teleport is being used
1180+
this.$nextTick(() => {
1181+
const rect = this.$el.getBoundingClientRect();
1182+
this.dropdownStyles = {
1183+
position: 'absolute',
1184+
top: `${rect.bottom + window.scrollY}px`,
1185+
left: `${rect.left + window.scrollX}px`,
1186+
width: `${rect.width}px`,
1187+
zIndex: 9999
1188+
};
1189+
this.ready = true;
1190+
});
1191+
} else {
11781192
this.ready = true;
1179-
});
1193+
}
11801194
}
11811195
}
11821196
}
@@ -1332,7 +1346,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
13321346
], 32 /* NEED_HYDRATION */))
13331347
: createCommentVNode("v-if", true)
13341348
], 512 /* NEED_PATCH */),
1335-
(openBlock(), createBlock(Teleport, { to: "body" }, [
1349+
(openBlock(), createBlock(Teleport, {
1350+
to: "body",
1351+
disabled: !$props.useTeleport
1352+
}, [
13361353
createVNode(Transition, { name: "multiselect" }, {
13371354
default: withCtx(() => [
13381355
(_ctx.isOpen && $data.ready)
@@ -1436,7 +1453,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
14361453
]),
14371454
_: 3 /* FORWARDED */
14381455
})
1439-
]))
1456+
], 8 /* PROPS */, ["disabled"]))
14401457
], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1))
14411458
}
14421459

dist/vue-multiselect.js

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,15 @@ var VueMultiselect = (function (exports, vue) {
10741074
required: {
10751075
type: Boolean,
10761076
default: false
1077+
},
1078+
/**
1079+
* Uses Vue Teleport's feature. Teleports the open dropdown to the bottom of the body element
1080+
* @default false
1081+
* @type {Boolean}
1082+
*/
1083+
useTeleport: {
1084+
type: Boolean,
1085+
default: false
10771086
}
10781087
},
10791088
data () {
@@ -1166,18 +1175,23 @@ var VueMultiselect = (function (exports, vue) {
11661175
watch: {
11671176
isOpen (val) {
11681177
if (val) {
1169-
this.ready = false;
1170-
this.$nextTick(() => {
1171-
const rect = this.$el.getBoundingClientRect();
1172-
this.dropdownStyles = {
1173-
position: 'absolute',
1174-
top: `${rect.bottom + window.scrollY}px`,
1175-
left: `${rect.left + window.scrollX}px`,
1176-
width: `${rect.width}px`,
1177-
zIndex: 9999
1178-
};
1178+
if (this.useTeleport) {
1179+
this.ready = false;
1180+
// This helps with the positioning of the open dropdown when teleport is being used
1181+
this.$nextTick(() => {
1182+
const rect = this.$el.getBoundingClientRect();
1183+
this.dropdownStyles = {
1184+
position: 'absolute',
1185+
top: `${rect.bottom + window.scrollY}px`,
1186+
left: `${rect.left + window.scrollX}px`,
1187+
width: `${rect.width}px`,
1188+
zIndex: 9999
1189+
};
1190+
this.ready = true;
1191+
});
1192+
} else {
11791193
this.ready = true;
1180-
});
1194+
}
11811195
}
11821196
}
11831197
}
@@ -1333,7 +1347,10 @@ var VueMultiselect = (function (exports, vue) {
13331347
], 32 /* NEED_HYDRATION */))
13341348
: vue.createCommentVNode("v-if", true)
13351349
], 512 /* NEED_PATCH */),
1336-
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
1350+
(vue.openBlock(), vue.createBlock(vue.Teleport, {
1351+
to: "body",
1352+
disabled: !$props.useTeleport
1353+
}, [
13371354
vue.createVNode(vue.Transition, { name: "multiselect" }, {
13381355
default: vue.withCtx(() => [
13391356
(_ctx.isOpen && $data.ready)
@@ -1437,7 +1454,7 @@ var VueMultiselect = (function (exports, vue) {
14371454
]),
14381455
_: 3 /* FORWARDED */
14391456
})
1440-
]))
1457+
], 8 /* PROPS */, ["disabled"]))
14411458
], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1))
14421459
}
14431460

0 commit comments

Comments
 (0)