Disable Material UI's <LinearProgress /> animation

戏子无情 提交于 2021-01-27 17:42:21

问题


I am using Material-UI's <LinearProgress variant="determinate" /> component which by default transforms the scaleX() property of a <div> inside another <div> whenever the value changes to visualize the current progress. It does so with an easing effect to make everything look smooth which generally is quite nice, however for the purpose of my application (audio seekbar) I would like to disable this animation entirely whenever the value changes.

Is it possible?

Demo codesandbox


回答1:


I was able to resolve this using overrides

bar: {
  transition: 'none
}
...

...
<LinearProgress variant="determinate" classes={{ bar: classes.bar}} />


来源:https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!