mirror of
https://github.com/rive-app/rive-react.git
synced 2026-03-13 08:22:30 +08:00
Fix: Prevent scrollbars from flashing on resize
This commit is contained in:
@@ -29,6 +29,7 @@ function RiveComponent({
|
||||
const containerStyle = {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
overflow: 'hidden',
|
||||
...style,
|
||||
};
|
||||
|
||||
|
||||
@@ -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 () => {
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user