Reputation: 5123
Here is how my custom Modal component is defined:
function Modal({ open, set_open, children }) {
const modal_ref = useRef(null);
useEffect(() => {
if (open) {
modal_ref.current.style.display = "block";
} else {
modal_ref.current.style.display = "none";
}
}, [open]);
return ReactDom.createPortal(
<div className="modal-container" ref={modal_ref}>
<div className="modal-content">{children}</div>
</div>,
document.getElementById("root")
);
}
The children property of the component will contain the tooltip. Or it may actually be the grandchildren.
But either way, it should appear, no?
Upvotes: 3
Views: 4665
Reputation: 2102
You can set this via a mui theme override as well.
export default function ThemeProvider({ children }: Props) {
const theme = createTheme({
zIndex: { tooltip: 99999 },
});
return (
<MUIThemeProvider theme={theme}>
{children}
</MUIThemeProvider>
);
}
Upvotes: 0
Reputation: 339
.MuiTooltip-popper {
z-index: 9999999 !important;
}
As much as I hate using !important
, that's what did the trick for me.
Upvotes: 6