Skip to content

Commit c86baa6

Browse files
authored
fix(action): create localized template for aria-label (#10969)
**Related Issue:** #9071 ## Summary - uses new message string for indicator label
1 parent c0d52fe commit c86baa6

File tree

1 file changed

+5
-4
lines changed
  • packages/calcite-components/src/components/action

1 file changed

+5
-4
lines changed

packages/calcite-components/src/components/action/action.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,11 @@ export class Action extends LitElement implements InteractiveComponent, Loadable
250250
buttonId,
251251
messages,
252252
} = this;
253-
const labelFallback = label || text;
254-
const ariaLabel = labelFallback
255-
? `${labelFallback}${indicator ? ` (${messages.indicator})` : ""}`
256-
: "";
253+
const labelFallback = label || text || "";
254+
255+
const ariaLabel = indicator
256+
? messages.indicatorLabel.replace("{label}", labelFallback)
257+
: labelFallback;
257258

258259
const buttonClasses = {
259260
[CSS.button]: true,

0 commit comments

Comments
 (0)