FIX: differentiate sk outline handling on single/multi (#9512)

This commit is contained in:
Joffrey JAFFEUX 2020-04-22 13:02:20 +02:00 committed by GitHub
parent 4e5f9d4cd1
commit 4889dbde49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 7 deletions

View File

@ -832,6 +832,8 @@ export default Component.extend(
placementStrategy = inModal ? "fixed" : "absolute";
}
const verticalOffset = this.multiSelect ? 0 : 2;
/* global Popper:true */
this.popper = Popper.createPopper(anchor, popper, {
eventsEnabled: false,
@ -841,7 +843,7 @@ export default Component.extend(
{
name: "offset",
options: {
offset: [0, 2]
offset: [0, verticalOffset]
}
},
{
@ -853,7 +855,7 @@ export default Component.extend(
".select-kit-wrapper"
);
if (wrapper) {
let height = this.element.offsetHeight;
let height = this.element.offsetHeight + verticalOffset;
const body = this.element.querySelector(".select-kit-body");
if (body) {
@ -873,7 +875,8 @@ export default Component.extend(
this.element.classList.add("is-under");
}
wrapper.style.width = `${this.element.offsetWidth}px`;
// - 1 accounts for any rounding error
wrapper.style.width = `${this.element.offsetWidth - 1}px`;
wrapper.style.height = `${height}px`;
}
}

View File

@ -53,6 +53,7 @@
.multi-select-header {
border-radius: 0;
box-shadow: none;
outline: none;
}
.select-kit-body {

View File

@ -34,10 +34,6 @@
box-sizing: border-box;
width: 100%;
}
.select-kit-header {
outline: 1px solid $tertiary;
}
}
&.is-loading {

View File

@ -8,4 +8,10 @@
border-bottom: 1px solid $primary-low;
}
}
&.is-expanded {
.select-kit-header {
outline: 1px solid $tertiary;
}
}
}