繁体   English   中英

select 元素的下拉菜单正在更改页面的背景(JS,MUI)

[英]Dropdown menu of a select element is changing the background of the page (JS, MUI)

我的网站有一个奇怪的问题,但这似乎是我正在使用的 UI 库的问题。 每次我单击页面中的 select 元素时,背景的宽度都会略有变化,这会使背景图像闪烁。 起初我虽然这是我的代码中的一个问题,但在检查之后,我发现在 UI 库文档中它也发生了。

例子:

  1. 我的网站: https://dinsangun.github.io/crypto-converter/
  2. The lib docs: https://mui.com/components/selects/ (In the lib docs, when you click a select element, pay attention to the slider on the right side, it disappears when the dropdown menu of the select items is点击)

有没有办法克服这个小错误?

谢谢。

您的问题来自滚动条,当您单击 select 时,它会消失,因此背景会延伸到整个屏幕。 MUI网站也是同样的问题。 我可以提出的解决方案之一是放在你的bodyroot div height:100vh;overflow:hidden;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM