From 46452f616f0ce7d9292968c03dc4fc93f397805a Mon Sep 17 00:00:00 2001 From: uros Date: Mon, 16 Sep 2024 23:02:11 +0200 Subject: [PATCH] fix: Multiselect - correctly default to locale when selectedItemsLabel is not specified. chore: update docs closes #6303 --- apps/showcase/doc/common/apidoc/index.json | 4 ++-- packages/primevue/scripts/components/multiselect.js | 2 +- packages/primevue/src/multiselect/BaseMultiSelect.vue | 2 +- packages/primevue/src/multiselect/MultiSelect.d.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/showcase/doc/common/apidoc/index.json b/apps/showcase/doc/common/apidoc/index.json index 7fa3aee09..a1831fa33 100644 --- a/apps/showcase/doc/common/apidoc/index.json +++ b/apps/showcase/doc/common/apidoc/index.json @@ -40412,7 +40412,7 @@ "readonly": false, "type": "string", "default": "'{0} items selected'", - "description": "Label to display after exceeding max selected labels." + "description": "Label to display after exceeding max selected labels. Defaults to value from PrimeVue locale configuration." }, { "name": "maxSelectedLabels", @@ -94997,4 +94997,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/primevue/scripts/components/multiselect.js b/packages/primevue/scripts/components/multiselect.js index 35ef21230..967ece301 100644 --- a/packages/primevue/scripts/components/multiselect.js +++ b/packages/primevue/scripts/components/multiselect.js @@ -165,7 +165,7 @@ const MultiSelectProps = [ name: 'selectedItemsLabel', type: 'string', default: '{0} items selected', - description: 'Label to display after exceeding max selected labels.' + description: 'Label to display after exceeding max selected labels. Defaults to value from PrimeVue locale configuration.' }, { name: 'maxSelectedLabels', diff --git a/packages/primevue/src/multiselect/BaseMultiSelect.vue b/packages/primevue/src/multiselect/BaseMultiSelect.vue index 0625302ec..5954e81ef 100644 --- a/packages/primevue/src/multiselect/BaseMultiSelect.vue +++ b/packages/primevue/src/multiselect/BaseMultiSelect.vue @@ -76,7 +76,7 @@ export default { }, selectedItemsLabel: { type: String, - default: '{0} items selected' + default: null }, maxSelectedLabels: { type: Number, diff --git a/packages/primevue/src/multiselect/MultiSelect.d.ts b/packages/primevue/src/multiselect/MultiSelect.d.ts index 83c60ed0c..ebaf25b2f 100755 --- a/packages/primevue/src/multiselect/MultiSelect.d.ts +++ b/packages/primevue/src/multiselect/MultiSelect.d.ts @@ -433,7 +433,7 @@ export interface MultiSelectProps { display?: 'comma' | 'chip' | undefined; /** * Label to display after exceeding max selected labels. - * @defaultValue '{0} items selected' + * @defaultValue 'null' */ selectedItemsLabel?: string | undefined; /** @@ -524,7 +524,7 @@ export interface MultiSelectProps { filterMessage?: string | undefined; /** * Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration. - * @defaultValue '{0} items selected' + * @defaultValue 'null' */ selectionMessage?: string | undefined; /**