-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[charts] browser reduce motion does not disable the initial animation in production #13477
Comments
Btw, I believe this happens because the // docs/pages/_app.js
import { Globals } from '@react-spring/web';
Globals.assign({
skipAnimation: true,
}); |
I was taking another look at the flaky regression test in core and when I set CPU throttling to 6x, I'm still seeing some sort of initial animation happening on Screen.Recording.2024-09-06.at.05.12.49.movEven with global animations turned off it seems to be rendering something narrower on the initial render. Just saying because these tests do Globals.assign({
skipAnimation: true,
}); Maybe this is a separate issue? |
By "responsive container" you still mean "of the chart", right? Because the direct parent element does not resize. |
Would it be possible that it is rendered in a size on ssr and then hydrated into another size? 🤔 It does indeed look like the chart just changed size. Are you able to check the svg properties when this is happening? |
It's the core regression testing fixture. It's not SSRed, it's rendered in a nested React root created in an effect. To reproduce:
In the devtool elements panel you mean? No, not really, it always resets on reload. |
Any specific browser? I didn't see this behaviour on chrome, tested both 6x and 20x |
That was on Chrome. This is firefox: Screen.Recording.2024-09-06.at.17.09.51.movSeeing the same on Safari, Edge and mobile chrome. But only when running locally, latest master. Not seeing it on the deployed version. Maybe it's something poisoning the build locally 🤔 |
Oddly enough, was seeing it happening when the CPU is not slowed down, but not after I open the Sweet spot is between ~912 - ~1590 where no shuflling happens I would assume this specific issue is due to some layout changes after css/js is loaded? |
I reduced the test fixture down to: import * as React from 'react';
import * as ReactDOMClient from 'react-dom/client';
import { Globals } from '@react-spring/web';
import Box from '@mui/material/Box';
import Grid from '@mui/material/Grid2';
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
Globals.assign({
skipAnimation: true,
});
function StatCard() {
return (
<Grid size={6} sx={{ height: 50 }}>
<SparkLineChart data={[1640, 220]} />
</Grid>
);
}
function App() {
return (
<Box sx={{ display: 'inline-block' }}>
<Grid container spacing={2}>
<StatCard />
<StatCard />
<StatCard />
</Grid>
</Box>
);
}
const container = document.getElementById('react-root');
const children = <App />;
const reactRoot = ReactDOMClient.createRoot(container);
reactRoot.render(children); Screen.Recording.2024-09-08.at.12.39.42.movIt looks like there is some interaction going on between the top level codesandbox behaves differently though. |
@Janpot the issue here seems to be that the container doesn't have a proper width, which means the children has to "grow until they fit" into the container. One alternative would be to change the component that has the I've created #14553 which should fix the issue in most common cases if the proper solution above is not possible. |
it's possible but it updates all the screenshots mui/material-ui#43656 |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. |
Steps to reproduce
See mui/material-ui#42537 (comment)
Current behavior
No response
Expected behavior
No response
Context
No response
Your environment
npx @mui/envinfo
Search keywords: a11y animation charts
The text was updated successfully, but these errors were encountered: