feat: reduce multiselect selector specificity (#2678)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2678 Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
parent
4a550da6a6
commit
9f0f0b39f8
@ -9,7 +9,8 @@
|
|||||||
<div class="control" :class="{'is-loading': loading || localLoading}">
|
<div class="control" :class="{'is-loading': loading || localLoading}">
|
||||||
<div
|
<div
|
||||||
class="input-wrapper input"
|
class="input-wrapper input"
|
||||||
:class="{'has-multiple': hasMultiple}">
|
:class="{'has-multiple': hasMultiple}"
|
||||||
|
>
|
||||||
<template v-if="Array.isArray(internalValue)">
|
<template v-if="Array.isArray(internalValue)">
|
||||||
<template v-for="(item, key) in internalValue">
|
<template v-for="(item, key) in internalValue">
|
||||||
<slot name="tag" :item="item">
|
<slot name="tag" :item="item">
|
||||||
@ -38,7 +39,7 @@
|
|||||||
<transition name="fade">
|
<transition name="fade">
|
||||||
<div class="search-results" :class="{'search-results-inline': inline}" v-if="searchResultsVisible">
|
<div class="search-results" :class="{'search-results-inline': inline}" v-if="searchResultsVisible">
|
||||||
<BaseButton
|
<BaseButton
|
||||||
class="is-fullwidth"
|
class="search-result-button is-fullwidth"
|
||||||
v-for="(data, index) in filteredSearchResults"
|
v-for="(data, index) in filteredSearchResults"
|
||||||
:key="index"
|
:key="index"
|
||||||
:ref="(el) => setResult(el, index)"
|
:ref="(el) => setResult(el, index)"
|
||||||
@ -58,7 +59,7 @@
|
|||||||
|
|
||||||
<BaseButton
|
<BaseButton
|
||||||
v-if="creatableAvailable"
|
v-if="creatableAvailable"
|
||||||
class="is-fullwidth"
|
class="search-result-button is-fullwidth"
|
||||||
:ref="(el) => setResult(el, filteredSearchResults.length)"
|
:ref="(el) => setResult(el, filteredSearchResults.length)"
|
||||||
@keydown.up.prevent="() => preSelect(filteredSearchResults.length - 1)"
|
@keydown.up.prevent="() => preSelect(filteredSearchResults.length - 1)"
|
||||||
@keydown.down.prevent="() => preSelect(filteredSearchResults.length + 1)"
|
@keydown.down.prevent="() => preSelect(filteredSearchResults.length + 1)"
|
||||||
@ -434,15 +435,6 @@ function focus() {
|
|||||||
.control.is-loading::after {
|
.control.is-loading::after {
|
||||||
top: .75rem;
|
top: .75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.has-search-results .input-wrapper {
|
|
||||||
border-radius: $radius $radius 0 0;
|
|
||||||
border-color: var(--primary) !important;
|
|
||||||
background: var(--white) !important;
|
|
||||||
|
|
||||||
&, &:focus-within {
|
|
||||||
border-bottom-color: var(--grey-200) !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-wrapper {
|
.input-wrapper {
|
||||||
@ -483,11 +475,22 @@ function focus() {
|
|||||||
background: var(--white) !important;
|
background: var(--white) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// doesn't seem to be used. maybe inside the slot?
|
||||||
.loader {
|
.loader {
|
||||||
margin: 0 .5rem;
|
margin: 0 .5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-search-results .input-wrapper {
|
||||||
|
border-radius: $radius $radius 0 0;
|
||||||
|
border-color: var(--primary) !important;
|
||||||
|
background: var(--white) !important;
|
||||||
|
|
||||||
|
&, &:focus-within {
|
||||||
|
border-bottom-color: var(--grey-200) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.search-results {
|
.search-results {
|
||||||
background: var(--white);
|
background: var(--white);
|
||||||
border-radius: 0 0 $radius $radius;
|
border-radius: 0 0 $radius $radius;
|
||||||
@ -500,12 +503,13 @@ function focus() {
|
|||||||
z-index: 100;
|
z-index: 100;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
&-inline {
|
.search-results-inline {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
.search-result-button {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
@ -523,21 +527,8 @@ function focus() {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.search-result {
|
&:focus,
|
||||||
white-space: nowrap;
|
&:hover {
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: .5rem .75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hint-text {
|
|
||||||
font-size: .75rem;
|
|
||||||
color: transparent;
|
|
||||||
transition: color $transition;
|
|
||||||
padding-left: .5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus, &:hover {
|
|
||||||
background: var(--grey-100);
|
background: var(--grey-100);
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
|
|
||||||
@ -550,6 +541,19 @@ function focus() {
|
|||||||
background: var(--grey-200);
|
background: var(--grey-200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-result {
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: .5rem .75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.hint-text {
|
||||||
|
font-size: .75rem;
|
||||||
|
color: transparent;
|
||||||
|
transition: color $transition;
|
||||||
|
padding-left: .5rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
x
Reference in New Issue
Block a user