Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-ui when closing the dialog it wont let me touch my page

So after i close the dialog box of material-ui, somehow i can't click or touch anything in my page

useState:

const [open, setOpen] = useState(false);

Function:

  const handleClose = () => {
setOpen(false);

};

Tag:

        <Dialogopen={open}TransitionComponent={Transition}keepMountedonClose={handleClose}></Dialog>
like image 552
WildPoker Avatar asked Oct 24 '25 19:10

WildPoker


1 Answers

Just had this issue in codesandbox and resolved it by making sure the Transition is at the highest level, not inside any functions, where the imports are.

import Button from "@mui/material/Button";

const Transition = React.forwardRef(function Transition(props, ref) {
  return <Slide direction="up" ref={ref} {...props} />;
});

export default function ActionAreaCard() {
like image 193
Max Avatar answered Oct 26 '25 09:10

Max



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!