Skip to content

Commit

Permalink
primefaces#17130 attempt to fix backward search
Browse files Browse the repository at this point in the history
  • Loading branch information
qwadrox committed Dec 21, 2024
1 parent c6b50ba commit 9af7bb3
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions packages/primeng/src/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2000,19 +2000,7 @@ export class Select extends BaseComponent implements OnInit, AfterViewInit, Afte
let optionIndex = -1;
let matched = false;

if (this.focusedOptionIndex() !== -1) {
optionIndex = this.visibleOptions()
.slice(this.focusedOptionIndex())
.findIndex((option) => this.isOptionMatched(option));
optionIndex =
optionIndex === -1
? this.visibleOptions()
.slice(0, this.focusedOptionIndex())
.findIndex((option) => this.isOptionMatched(option))
: optionIndex + this.focusedOptionIndex();
} else {
optionIndex = this.visibleOptions().findIndex((option) => this.isOptionMatched(option));
}
optionIndex = this.visibleOptions().findIndex((option) => this.isOptionMatched(option));

if (optionIndex !== -1) {
matched = true;
Expand Down

0 comments on commit 9af7bb3

Please sign in to comment.