Skip to content
Merged
Show file tree
Hide file tree
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 @@ -58,8 +58,12 @@ describe('Content', () => {
</Stepper.Step>
</Stepper>
);
const visibleElement = queryByText('Blueberry');
const hiddenElement = queryByText('Strawberry');

expect(queryByText('Blueberry')).toHaveAttribute('aria-hidden', 'false');
expect(queryByText('Strawberry')).toHaveAttribute('aria-hidden', 'true');
expect(visibleElement).toHaveAttribute('aria-hidden', 'false');
expect(visibleElement).not.toHaveAttribute('inert');
expect(hiddenElement).toHaveAttribute('aria-hidden', 'true');
expect(hiddenElement).toHaveAttribute('inert');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const ContentComponent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElemen

return isHorizontal === false ? (
<StyledContent ref={ref} $isActive={isActive} {...props}>
<StyledInnerContent aria-hidden={!isActive}>{props.children}</StyledInnerContent>
<StyledInnerContent aria-hidden={!isActive} inert={isActive ? undefined : ''}>
{props.children}
</StyledInnerContent>
</StyledContent>
) : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden

const COMPONENT_ID = 'accordions.step_inner_content';

export const StyledInnerContent = styled.div.attrs<ThemeProps<DefaultTheme>>({
interface IStyledInnerContentProps extends ThemeProps<DefaultTheme> {
inert?: string;
}

export const StyledInnerContent = styled.div.attrs({
'data-garden-id': COMPONENT_ID,
'data-garden-version': PACKAGE_VERSION
})`
})<IStyledInnerContentProps>`
overflow: hidden;
line-height: ${props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md)};
color: ${({ theme }) => getColor({ theme, variable: 'foreground.default' })};
Expand Down
Loading