Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix search selection option focus (#2842)" #2902

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ export abstract class BaseSearchSelectorComponent extends BaseFormFieldControlCo
}
this._selectableItemsList = this.sortFn ? allItems.sort(this.sortFn) : allItems;
this.filteredItemsSubject.next(this.getFilteredItemsBySearchValue());
this.updateOptionFocus();
}

protected get selectableItems(): Selectable[] {
Expand Down Expand Up @@ -258,15 +257,6 @@ export abstract class BaseSearchSelectorComponent extends BaseFormFieldControlCo
document.body.appendChild(sheet);
}

private updateOptionFocus(): void {
setTimeout(() => {
if (!this.matSelect?.options.some(o => o.active)) {
this.matSelect.options.first.focus();
this.matSelect.options.first.setActiveStyles();
}
}, 200);
}

public onChipRemove(itemId: Id): void {
this.addOrRemoveId(itemId);

Expand Down Expand Up @@ -348,7 +338,6 @@ export abstract class BaseSearchSelectorComponent extends BaseFormFieldControlCo

protected onSearchValueUpdated(nextValue: string): void {
this.filteredItemsSubject.next(this.getFilteredItemsBySearchValue(nextValue.toLowerCase()));
this.updateOptionFocus();
}

protected initializeForm(): void {
Expand Down