Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make stepper region focusable if scrollable #876

1 change: 1 addition & 0 deletions src/components/Stepper/Stepper.tsx
cpatil-c-eightfold marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ export const Stepper: FC<StepperProps> = React.forwardRef(
className={styles.stepsContainer}
onScroll={handleScroll}
ref={stepsContainerRef}
tabIndex={mergedScrollable ? 0 : null}
>
<ul className={styles.steps} ref={stepsRef}>
{steps.map((step: Step, index: number) => {
Expand Down
12 changes: 12 additions & 0 deletions src/components/Stepper/Tests/Stepper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,16 @@ describe('Stepper', () => {
);
expect(wrapper.render()).toMatchSnapshot();
});

test('Stepper is scrollable', () => {
const wrapper = mount(
<Stepper
{...stepperArgs}
size={StepperSize.Small}
steps={defaultWorkflow}
scrollable
/>
);
expect(wrapper.render()).toMatchSnapshot();
});
});
Loading
Loading