fix(core): Eugeny/tabby#8709 sort freeInputPattern by weight

This commit is contained in:
Clem Fern 2023-07-20 20:15:36 +02:00
parent 4dedbbc25a
commit d57757c66c

View File

@ -76,7 +76,7 @@ export class SelectorModalComponent<T> {
{ sort: true },
).search(f)
this.options.filter(x => x.freeInputPattern).forEach(freeOption => {
this.options.filter(x => x.freeInputPattern).sort(firstBy<SelectorOption<T>, number>(x => x.weight ?? 0)).forEach(freeOption => {
if (!this.filteredOptions.includes(freeOption)) {
this.filteredOptions.push(freeOption)
}