Fix maxItemText for maxItemCount === 1

Singular / Plural
This commit is contained in:
Fareesh Vijayarangam 2023-11-25 03:05:37 +05:30 committed by GitHub
parent d33e2cd55d
commit 02b2cd2aed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,7 +69,7 @@ export const DEFAULT_CONFIG: Options = {
uniqueItemText: 'Only unique values can be added',
customAddItemText: 'Only values matching specific conditions can be added',
addItemText: (value) => `Press Enter to add <b>"${sanitise(value)}"</b>`,
maxItemText: (maxItemCount) => `Only ${maxItemCount} ${maxItemCount == 1 'value' : 'values'} can be added`,
maxItemText: (maxItemCount) => `Only ${maxItemCount} ${maxItemCount === 1 'value' : 'values'} can be added`,
valueComparer: (value1, value2) => value1 === value2,
fuseOptions: {
includeScore: true,