tleunen / react-mdl

React Components for Material Design Lite
https://tleunen.github.io/react-mdl/
MIT License
1.76k stars 255 forks source link

Opening a <Menu /> (or any other kind of pop-up) inside a <Dialog /> #474

Open developer94404 opened 7 years ago

developer94404 commented 7 years ago

[x] Question

Is it possible to open a<Menu />inside a <Dialog />?

I have tried:

  1. react-mdl <Menu />
  2. react-mdl-extra <Menu />
  3. react-portal <Portal />

All three have been unable to render inside a <Dialog /> ; they are all activated by a simple react-mdl <Button >

Thanks for any help.

saboya commented 7 years ago

I'm not sure about react-mdl's menu specifically, but nothing using react-portal will work (like react-mdl-extra), because react-mdl uses html5 dialog. The alternative you have is using another modal implementation, that does not use html5 dialog.

I hit the same issue and was using react-toolbox's modal, but that basically pulls an extra 400kb (unminified / ungzipped) to your bundle for a single feature.

I ended up ditching react-mdl-extra selectfield and implementing my own, and went back to react-mdl dialog.