Skip to content

Commit

Permalink
Merge pull request #997 from ae-utbm/counter
Browse files Browse the repository at this point in the history
Fix inconsistent search behavior on counter click codes
  • Loading branch information
klmp200 authored Jan 9, 2025
2 parents 843ce2e + 9f33ddd commit 894690a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@ export class CounterProductSelect extends AutoCompleteSelectBase {
return {
...super.tomSelectSettings(),
openOnFocus: false,
searchField: ["code", "text"],
// We make searching on exact code matching a higher priority
// We need to manually set weights or it results on an inconsistent
// behavior between production and development environment
searchField: [
// @ts-ignore documentation says it's fine, specified type is wrong
{ field: "code", weight: 2 },
// @ts-ignore documentation says it's fine, specified type is wrong
{ field: "text", weight: 0.5 },
],
};
}
}

0 comments on commit 894690a

Please sign in to comment.