Fix search not hiding elements
This commit is contained in:
parent
12850294e9
commit
82ccdb3a55
1 changed files with 5 additions and 4 deletions
|
@ -160,7 +160,7 @@ export class BetterSelect extends HTMLElement {
|
||||||
#text:empty ~ *[name="clear"] {
|
#text:empty ~ *[name="clear"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
[part="drop-down"], [part="item"] {
|
[part="drop-down"], [part~="item"] {
|
||||||
/* Resets */
|
/* Resets */
|
||||||
border: unset;
|
border: unset;
|
||||||
outline: unset;
|
outline: unset;
|
||||||
|
@ -195,10 +195,10 @@ export class BetterSelect extends HTMLElement {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[part="item"]:focus {
|
[part~="item"]:focus {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
[part="item"][hidden] {
|
[part~="item"][hidden] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
slot[name="loading"] {
|
slot[name="loading"] {
|
||||||
|
@ -421,8 +421,9 @@ export class BetterSelect extends HTMLElement {
|
||||||
/** @param {String} value */
|
/** @param {String} value */
|
||||||
search(value) {
|
search(value) {
|
||||||
for (const item of this.list.children) {
|
for (const item of this.list.children) {
|
||||||
if (item instanceof HTMLElement)
|
if (item instanceof HTMLElement) {
|
||||||
item.toggleAttribute("hidden", !this.match(value, item))
|
item.toggleAttribute("hidden", !this.match(value, item))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue