2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

fix: use width from getBoundingClientRect as the default for calculatePosition (#1114)

* fix: use box-sizing: border-box; on dropdown menu

Co-authored-by: Jeff <sagalbot@gmail.com>
This commit is contained in:
Hector Romero
2020-03-19 10:12:32 -07:00
committed by GitHub
parent 349d5c3856
commit fea430df27
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
export default {
inserted (el, bindings, {context}) {
if (context.appendToBody) {
const {height, top, left} = context.$refs.toggle.getBoundingClientRect();
const {height, top, left, width} = context.$refs.toggle.getBoundingClientRect();
el.unbindPosition = context.calculatePosition(el, context, {
width: context.$refs.toggle.clientWidth + 'px',
width: width + 'px',
top: (window.scrollY + top + height) + 'px',
left: (window.scrollX + left) + 'px',
});
+1
View File
@@ -13,6 +13,7 @@ $max-height: $vs-dropdown-max-height;
.vs__dropdown-menu {
display: block;
box-sizing: border-box;
position: absolute;
top: calc(100% - #{$border-width}); // -{#$border-width} here ensures the left and right borders of the dropdown appear flush with the toggle.
left: 0;