我正在尝试将自定义的卷轴组件添加到我的选项列表中,

发布于 2025-02-04 05:22:08 字数 913 浏览 3 评论 0 原文

我正在尝试添加此scroll- https:///www.npmjs.com/包装/反应custom-scrollbars-2 材料ui ui autocomplete 选项列表。 我的应用程序在各处使用相同的滚动组件,UI看起来确实可以使用MUI自动完成的传统默认滚动。

链接到组件 - https://codesandbox.io/s/eioiuz?file=/demo.tsx

以下是现在的样子 - https://i.sstatic.net/uwwvif.png < /a>

这是我希望滚动栏看起来像 - https://i.sstatic.net/AM367 .png

I am trying to add this scroll- https://www.npmjs.com/package/react-custom-scrollbars-2
to the Material UI autocomplete list of options.
My application is using the same scroll component everywhere and the UI looks really off with the traditional default scroll that we have on mui autocomplete.

Link to component-
https://codesandbox.io/s/eioiuz?file=/demo.tsx

Here's how it looks right now- https://i.sstatic.net/Uwvif.png

Here's how I want the scrollbar to look like- https://i.sstatic.net/AM367.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

书间行客 2025-02-11 05:22:08

解决此问题的一种可能方法是造成MUI自动完成列表组件框使用的默认标签。例如 ul :: - webkit-scrollbar {width:4px; } 将减少滚动条的大小。

A possible way to solve this problem is by styling the default tag used by MUI Autocomplete list component box. For Example ul::-webkit-scrollbar { width: 4px; } will reduce the size of the scrollbar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文