Skip to content

Commit eb70f39

Browse files
committed
chore: reverted combobox controller changes
1 parent b1baf62 commit eb70f39

File tree

2 files changed

+11
-29
lines changed

2 files changed

+11
-29
lines changed

core/pfe-core/controllers/combobox-controller.ts

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -525,39 +525,19 @@ export class ComboboxController<
525525
}
526526

527527
#filterItems() {
528-
if (!this.#input) {
529-
return;
530-
}
531-
const value = this.options.getComboboxValue(this.#input);
532-
let filteredOption = 0;
533-
for (const item of this.items) {
534-
const isExpanded = this.options.isExpanded?.() ?? false;
535-
const matchesFilter = this.options.isItemFiltered?.(item, value) ?? false;
536-
// Increment the filtered option list count by 1 to limit the no of options shown
537-
if (!isExpanded || !matchesFilter) {
538-
filteredOption++;
528+
if (this.#input) {
529+
let value: string;
530+
for (const item of this.items) {
531+
const hidden =
532+
!!this.options.isExpanded()
533+
&& !!(value = this.options.getComboboxValue(this.#input))
534+
&& this.options.isItemFiltered?.(item, value)
535+
|| false;
536+
this.options.setItemHidden(item, hidden);
539537
}
540-
// Determine if the item should be hidden
541-
const hidden = (isExpanded && matchesFilter) || filteredOption > 5;
542-
this.options.setItemHidden(item, hidden);
543538
}
544539
}
545540

546-
// Commented the actual function for filter and will be uncommenting this
547-
// #filterItems() {
548-
// if (this.#input) {
549-
// let value: string;
550-
// for (const item of this.items) {
551-
// const hidden =
552-
// !!this.options.isExpanded()
553-
// && !!(value = this.options.getComboboxValue(this.#input))
554-
// && this.options.isItemFiltered?.(item, value)
555-
// || false;
556-
// this.options.setItemHidden(item, hidden);
557-
// }
558-
// }
559-
// }
560-
561541
#onClickButton = () => {
562542
if (!this.options.isExpanded()) {
563543
this.#show();

elements/pf-search-input/pf-search-input.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@
189189
#outer.expanded #listbox-container {
190190
opacity: 1;
191191
z-index: 9999 !important;
192+
max-height: 220px;
193+
overflow: hidden;
192194
}
193195

194196
#listbox {

0 commit comments

Comments
 (0)