mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(list-box-selection): fix aria-label
for clear button (#2134)
`ListBoxSelection`, used by `MultiSelect` and `ComboBox`, currently applies the wrong `aria-label` for the clear selection button. It uses the `translateId` (e.g., `"clearAll"`) instead of the user-friendly copy.
This commit is contained in:
parent
c6c80d35a9
commit
dd1338ffc4
3 changed files with 16 additions and 5 deletions
|
@ -48,7 +48,9 @@
|
|||
$: translationId = selectionCount
|
||||
? translationIds.clearAll
|
||||
: translationIds.clearSelection;
|
||||
|
||||
$: buttonLabel =
|
||||
translateWithId?.(translationIds.clearAll) ??
|
||||
defaultTranslations[translationIds.clearAll];
|
||||
$: description =
|
||||
translateWithId?.(translationId) ?? defaultTranslations[translationId];
|
||||
</script>
|
||||
|
@ -79,7 +81,7 @@
|
|||
}
|
||||
}}
|
||||
{disabled}
|
||||
aria-label={translationIds.clearAll}
|
||||
aria-label={buttonLabel}
|
||||
title={description}
|
||||
>
|
||||
<Close />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue