direflow icon indicating copy to clipboard operation
direflow copied to clipboard

Fix for Material-ui tooltip display issue

Open vijay-kumar-singh opened this issue 3 years ago • 1 comments

When using material-ui tooltip component, tooltip pop up DOM elements getting generated out of web component. Sample code to fix this issue:

import { RootRef } from '@material-ui/core';
import Tooltip from '@material-ui/core/Tooltip';
import Button from '@material-ui/core/Button';

const domRef = React.useRef();

 <RootRef rootRef={domRef}>
         <Tooltip title="Add" arrow PopperProps={{container:domRef.current}}>
              <Button>Arrow</Button>
         </Tooltip>
  </RootRef>

Happy coding :)

vijay-kumar-singh avatar Jun 11 '21 12:06 vijay-kumar-singh

Thank you it worked, you saved me hours of research.

hacking-robot avatar Dec 16 '21 16:12 hacking-robot