Skip to content

Commit 94c4bbf

Browse files
committed
feat(styles): add support for custom className and style in DualScrollSyncContent component
1 parent a6ebfdb commit 94c4bbf

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

lib/components/DualScrollSync/DualScrollSyncContent/DualScrollSyncContent.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,17 @@ describe('DualScrollSyncContent', () => {
1717

1818
expect(getByTestId('test-content-id')).toBeInTheDocument();
1919
});
20+
21+
it('should apply custom className and style', () => {
22+
const { getByTestId } = render(
23+
<DualScrollSyncContent className="custom-class" style={{ borderWidth: '1px' }}>
24+
<div>Styled Content</div>
25+
</DualScrollSyncContent>
26+
);
27+
28+
const content = getByTestId('test-content-id');
29+
30+
expect(content).toHaveClass('custom-class');
31+
expect(content).toHaveStyle('border-width: 1px');
32+
});
2033
});

lib/components/DualScrollSync/DualScrollSyncContent/DualScrollSyncContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export const DualScrollSyncContent: FC<DualScrollSyncContentProps> = ({
1616
return (
1717
<section
1818
className={clsx(styles.scrollSyncContent, className)}
19-
style={style}
2019
data-testid={contentId}
2120
id={contentId}
2221
ref={contentRef}
22+
style={style}
2323
>
2424
{children}
2525
</section>

0 commit comments

Comments
 (0)