diff --git a/src-docs/src/views/steps/steps_horizontal.js b/src-docs/src/views/steps/steps_horizontal.js index e0c899f0b39..fd1bd43690f 100644 --- a/src-docs/src/views/steps/steps_horizontal.js +++ b/src-docs/src/views/steps/steps_horizontal.js @@ -8,6 +8,7 @@ const horizontalSteps = [ { title: 'Completed Step 1', isComplete: true, + onClick: () => window.alert('Step 1 clicked') }, { title: 'Selected Step 2', diff --git a/src/components/steps/_steps_horizontal.scss b/src/components/steps/_steps_horizontal.scss index 588d06024ce..90bc54fa31a 100644 --- a/src/components/steps/_steps_horizontal.scss +++ b/src/components/steps/_steps_horizontal.scss @@ -34,6 +34,11 @@ } } + // disabled state + &[disabled] { + cursor: not-allowed; + } + // create the connecting lines position: relative; &::before, diff --git a/src/components/steps/step_horizontal.js b/src/components/steps/step_horizontal.js index 44be23db4ad..dfeecf05175 100644 --- a/src/components/steps/step_horizontal.js +++ b/src/components/steps/step_horizontal.js @@ -14,6 +14,7 @@ export const EuiStepHorizontal = ({ title, isSelected, isComplete, + onClick, disabled, ...rest }) => { @@ -49,6 +50,7 @@ export const EuiStepHorizontal = ({ aria-selected={!!isSelected} type="button" className={classes} + onClick={onClick} disabled={disabled} title={buttonTitle} {...rest} diff --git a/src/components/steps/steps_horizontal.js b/src/components/steps/steps_horizontal.js index 31f44bc4ebc..fd9f9279e87 100644 --- a/src/components/steps/steps_horizontal.js +++ b/src/components/steps/steps_horizontal.js @@ -13,6 +13,7 @@ function renderHorizontalSteps(steps) { className, disabled, isSelected, + onClick, ...rest } = step; @@ -23,6 +24,7 @@ function renderHorizontalSteps(steps) { step={index + 1} disabled={disabled} isSelected={isSelected} + onClick={onClick} {...rest} > {children} diff --git a/src/components/steps/steps_horizontal.test.js b/src/components/steps/steps_horizontal.test.js index 1a3c542a3c3..bfae6aeee0a 100644 --- a/src/components/steps/steps_horizontal.test.js +++ b/src/components/steps/steps_horizontal.test.js @@ -8,6 +8,7 @@ const steps = [ { title: 'Completed Step 1', isComplete: true, + onClick: () => window.alert('Step 1 clicked'), }, { title: 'Selected Step 2',