Skip to content

Commit

Permalink
🏐
Browse files Browse the repository at this point in the history
  • Loading branch information
jpzwarte committed Sep 23, 2024
1 parent 39fe44a commit 444fa36
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/components/combobox/src/combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,14 +681,19 @@ export class Combobox<T = unknown> extends FormControlMixin(ScopedElementsMixin(
let match = !this.filterResults || !value;
if (!match) {
match = option.content.toLowerCase().startsWith(value!.toLowerCase());
noMatch = !match;
}

if (noMatch && match) {
noMatch = false;
}

if (option.element) {
option.element.style.display = match ? '' : 'none';
}
});

console.log({ noMatch, value });

if (noMatch && value) {
this.#noMatch ||= this.shadowRoot!.createElement('sl-combobox-no-match') as NoMatch;
this.#noMatch.value = value;
Expand Down

0 comments on commit 444fa36

Please sign in to comment.