Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ export const WizardToggle = ({
'aria-label': ariaLabel = 'Wizard toggle'
}: WizardToggleProps) => {
const isActiveSubStep = isWizardSubStep(activeStep);
const parentStep = isActiveSubStep && steps.find(step => step.id === activeStep.parentId);
const nonSubSteps = steps.filter(step => !isWizardSubStep(step));
const wizardToggleIndex =
nonSubSteps.indexOf(
isWizardSubStep(activeStep) ? steps.find(step => step.id === activeStep.parentId) : activeStep
) + 1;
const wizardToggleIndex = nonSubSteps.indexOf(parentStep || activeStep) + 1;

const handleKeyClicks = React.useCallback(
(event: KeyboardEvent): void => {
Expand Down Expand Up @@ -91,7 +89,8 @@ export const WizardToggle = ({
>
<span className={css(styles.wizardToggleList)}>
<span className={css(styles.wizardToggleListItem)}>
<span className={css(styles.wizardToggleNum)}>{wizardToggleIndex}</span> {activeStep?.name}
<span className={css(styles.wizardToggleNum)}>{wizardToggleIndex}</span>{' '}
{parentStep?.name || activeStep?.name}
{isActiveSubStep && <AngleRightIcon className={css(styles.wizardToggleSeparator)} aria-hidden="true" />}
</span>
{isActiveSubStep && <span className={css(styles.wizardToggleListItem)}>{activeStep?.name}</span>}
Expand Down