1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-25 19:17:39 +03:00

fix(core): push all freeInputPattern into filteredOptions selectorModal

This commit is contained in:
Clem Fern 2023-07-15 21:35:01 +02:00
parent 555c7f7b20
commit 9ac5286017

View File

@ -76,10 +76,11 @@ export class SelectorModalComponent<T> {
{ sort: true },
).search(f)
const freeOption = this.options.find(x => x.freeInputPattern)
if (freeOption && !this.filteredOptions.includes(freeOption)) {
this.filteredOptions.push(freeOption)
}
this.options.filter(x => x.freeInputPattern).forEach(freeOption => {
if (freeOption && !this.filteredOptions.includes(freeOption)) {
this.filteredOptions.push(freeOption)
}
})
}
this.selectedIndex = Math.max(0, this.selectedIndex)
this.selectedIndex = Math.min(this.filteredOptions.length - 1, this.selectedIndex)