Skip to content
Open
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
1 change: 1 addition & 0 deletions src/hooks/useRive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function RiveComponent({
const containerStyle = {
width: '100%',
height: '100%',
overflow: 'hidden',
...style,
};

Expand Down
2 changes: 2 additions & 0 deletions test/useRive.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ describe('useRive', () => {
<RiveTestComponent className="rive-test-clas" style={{ width: '50%' }} />
);
expect(container.firstChild).not.toHaveStyle('width: 50%');
expect(container.firstChild).not.toHaveStyle('overflow: hidden');
});

it('has a canvas size of 0 by default', async () => {
Expand All @@ -454,6 +455,7 @@ describe('useRive', () => {
const { RiveComponent: RiveTestComponent } = result.current;
const { container } = render(<RiveTestComponent />);
expect(container.querySelector('canvas')).toHaveStyle('width: 0');
expect(container.firstChild).toHaveStyle('overflow: hidden');
});

it('sets the canvas width and height after calculating the container size', async () => {
Expand Down
Loading