图标按钮的巨大选择半径MUI React

发布于 2025-02-09 15:53:28 字数 471 浏览 1 评论 0原文

只是在图标按钮上摆脱了这些巨大的选择时遇到一些困难,这些按钮可以在这里看到: 大型选择

我发现一个修复程序是添加的:component ='span =“ span”

  1. 为什么此功能这是一个错误吗?我还应该提到我已经使用任何其他DIV或任何自定义CSS内的图标按钮对此进行了测试,但它的行为仍然相同。
  2. 我将如何将此组件=“跨度”固定到我相信使用其中的图标按钮的自动完成组件上,请参阅此处:自动完成图标按钮。在右侧,下拉箭头和交叉按钮共享此大型选择,我认为也是图标按钮。

谢谢!

just having some trouble getting rid of these huge selections on icon buttons which can be seen here:
Large selection

I have found a fix is adding: component="span"

  1. Why does this work/is this a bug? I should also mention I have tested this with the icon button not inside any other divs or any custom CSS and it still behaves the same.
  2. How would I apply this component="span" fix to the autocomplete component which I believe uses icon buttons inside it, please see here: Autocomplete icon button. On the right the drop down arrow and cross buttons share this large selection and I assume are also Icon Buttons.

Thanks!

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

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

发布评论

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

评论(1

叹倦 2025-02-16 15:53:28
    import {createTheme} from "@material-ui/core";
    
     const themeSearch = createTheme({
        overrides: {
            MuiIconButton: {
                root: {
                    "&:hover": {
                        backgroundColor: 'transparent !important',
                    },
                },
            },
        },
    });

<ThemeProvider theme={themeSearch}>
  <div> your JSX </div>
</ThemeProvider>
    import {createTheme} from "@material-ui/core";
    
     const themeSearch = createTheme({
        overrides: {
            MuiIconButton: {
                root: {
                    "&:hover": {
                        backgroundColor: 'transparent !important',
                    },
                },
            },
        },
    });

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