Skip to content

Commit

Permalink
[EuiStepsHorizontal] Added aria-disabled attribute when status is "…
Browse files Browse the repository at this point in the history
…disabled" (elastic#7699)
  • Loading branch information
1Copenut authored and mgadewoll committed May 3, 2024
1 parent 44931b0 commit c8f4f36
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/upcoming/7699.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Accessibility**

- Added `aria-disabled` attribute to `EuiHorizontalSteps` when status is "disabled"
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ exports[`EuiStepHorizontal props status danger is rendered 1`] = `

exports[`EuiStepHorizontal props status disabled is rendered 1`] = `
<button
aria-disabled="true"
class="euiStepHorizontal emotion-euiStepHorizontal-disabled"
data-step-status="disabled"
title="Step 1 is disabled"
Expand Down Expand Up @@ -183,6 +184,7 @@ exports[`EuiStepHorizontal props status disabled is rendered 1`] = `

exports[`EuiStepHorizontal props status disabled overrides the passed status 1`] = `
<button
aria-disabled="true"
class="euiStepHorizontal emotion-euiStepHorizontal-disabled"
data-step-status="disabled"
disabled=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ exports[`EuiStepsHorizontal is rendered 1`] = `
class="euiStepsHorizontal__item emotion-euiStepsHorizontal__item"
>
<button
aria-disabled="true"
class="euiStepHorizontal emotion-euiStepHorizontal-disabled"
data-step-status="disabled"
title="Step 4: Disabled Step 4 is disabled"
Expand Down
1 change: 1 addition & 0 deletions src/components/steps/step_horizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const EuiStepHorizontal: FunctionComponent<EuiStepHorizontalProps> = ({

return (
<button
aria-disabled={status === 'disabled' ? true : undefined}
className={classes}
title={titleAttr}
onClick={onStepClick}
Expand Down

0 comments on commit c8f4f36

Please sign in to comment.