Skip to content

Commit 339dd74

Browse files
authored
fix(FilterableMultiSelect): fix extra colon (#19428)
* fix(FilterableMultiSelect): fix extra colon Minimal fix for extra colon in hidden "Total items selected: : 0" message. Note that it already worked correctly when one or more items were selected. I don't like the way FilterableMultiSelect adds hidden text to the label, but aria-describedby is already being used to point to the (visible) helper text. Fixes #19424. * fix(FilterableMultiSelect): remove duplicate cds--visually-hidden span Fixes #19424.
1 parent 57147ac commit 339dd74

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/react/src/components/MultiSelect/FilterableMultiSelect.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -861,16 +861,9 @@ export const FilterableMultiSelect = forwardRef(function FilterableMultiSelect<
861861
: {};
862862

863863
const clearSelectionContent =
864-
controlledSelectedItems.length > 0 ? (
865-
<span className={`${prefix}--visually-hidden`}>
866-
{clearSelectionDescription} {controlledSelectedItems.length},
867-
{clearSelectionText}
868-
</span>
869-
) : (
870-
<span className={`${prefix}--visually-hidden`}>
871-
{clearSelectionDescription}: 0
872-
</span>
873-
);
864+
controlledSelectedItems.length > 0
865+
? `${clearSelectionDescription} ${controlledSelectedItems.length}. ${clearSelectionText}.`
866+
: `${clearSelectionDescription} 0.`;
874867

875868
return (
876869
<div className={wrapperClasses}>

0 commit comments

Comments
 (0)