简体   繁体   English

React-js MUI Tooltip 重叠 Popper

[英]React-js MUI Tooltip overlapping Popper

I want the MUI tooltip to go beneath the MUI Popper that is popper should overlap the tooltip.我希望 MUI 工具提示位于 popper 的 MUI Popper 下方,应该与工具提示重叠。 If I override the "MuiTooltip" or "MuiTooltip-popper"s z-index using external css, it's getting applied globally, which I don't want.如果我使用外部 css 覆盖“MuiTooltip”或“MuiTooltip-popper”的 z-index,它将被全局应用,这是我不想要的。

Is there a way to override either tooltip or popper behaviour & modify the z-index only for some portion ?有没有办法覆盖工具提示或弹出器行为并仅修改某些部分的 z-index ?

sandbox: https://codesandbox.io/s/tooltip-popper-issue-myryfv?file=/src/App.js沙盒: https ://codesandbox.io/s/tooltip-popper-issue-myryfv?file=/src/App.js

note: If the popper in the sandbox is not in the center, try to modify the code.注意:如果沙箱中的popper不在中心,请尝试修改代码。 Let the error appear & undo the modification.让错误出现并撤消修改。

I am using MUI v4我正在使用 MUI v4

Popper 的工具提示

Remove external css and just add style prop to Popper component.删除外部 css 并将 style 属性添加到Popper组件。

<Popper
   style={{
     zIndex: 1501
   }}
   anchorEl={buttonRef.current}
>

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

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