React如何删除Material-UI Select的动画 [英] React How to remove the animation of Material-UI Select

查看:83
本文介绍了React如何删除Material-UI Select的动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用React Material UI的选择组件".我希望删除或加快打开菜单时出现的动画.我尝试过类似的事情:

I'm using the React Material UI's Select Component. I wish to remove or speeden the animation that comes when the menu is opening. I tried something like:

 <Select
     ...
     TransitionComponent={({children}) => children}
 >
     <MenuItem value={...}>...</MenuItem>
     ...
 </Select>

但这不起作用,请帮助

推荐答案

将此添加到样式表中:

.MuiMenu-paper {
    transition-duration: 0s !important;
}

这基本上会覆盖选择下拉列表的过渡持续时间,并将其设置为0秒.

This basically overrides the transition duration of the select dropdown and sets it to 0 seconds.

您还可以根据自己的喜好更改持续时间(使其更快).默认的动画持续时间为:

You can also change the duration according to what you like (make it faster). The default animation duration is:

transition-duration: 251ms, 167ms;

这篇关于React如何删除Material-UI Select的动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆