Merge pull request #997 from ae-utbm/counter

Fix inconsistent search behavior on counter click codes
This commit is contained in:
Bartuccio Antoine 2025-01-09 22:32:59 +01:00 committed by GitHub
commit 894690a97f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,7 +76,15 @@ export class CounterProductSelect extends AutoCompleteSelectBase {
return { return {
...super.tomSelectSettings(), ...super.tomSelectSettings(),
openOnFocus: false, 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 },
],
}; };
} }
} }