How do I create a window in react? - reactjs

Is there any component similar to ext.window in react?
I checked bootstrap/material ui and the closest thing to a window are modals, but I would like to find something resizable and draggable.

You can try specific components that do this, like react-rnd.
See the demo, you can both resize and drag the created component.
Here, you have a live example in codesandbox.

What you need is a draggable modal with React implementation:
Bootstrap draggable modal
https://gist.github.com/burgalon/870a68de68c5ed15c416fab63589d503
Material UI draggable modal
https://codesandbox.io/s/nnq98zlrrl

I've been using Material-Ui for a while.
There's a standard modal and dialog (like a modal but with default template for easier customization)
Isn't modal (dialog) sufficient for the job that you want?

Related

In the full screen component, the Material Ui modal does not work

I am using react-full-screen node package to make a full screen component, however modals, popovers, and drawers do not work.
Could you please help me make a working modal within my full screen component?
Are you sure it doesn't work ? maybe your modals are well displayed but behind your fullscreen component (did you use devtool's element inspector to check the html / css to see if your modal was here ?).
You might need to enrich your modal's css to make it visible ahead of fullscreen component, a mere z-index: 2 on the modal' style could help ?

MUI Backdrop goes behind MUI Dialog

I have a loading overlay that uses the MUI Backdrop component. This works perfectly fine until I have a MUI Dialog open or a MUI Drawer open. In these scenarios, the Backdrop component renders behind the Dialog or Drawer. I have tried even throwing an !important on the zIndex of the Backdrop and setting it to 10000 and it will still render behind the Dialog or Drawer every time.
Has anyone else ever had this issue and been able to figure out how to get the Backdrop to always show up on top of any element on the page?
without a code example I am not 100 but I hope this helps... both Drawer (via passing modal in its props) and Dialog use the Backdrop component. So perhaps it is the parent div which zIndex needs to be altered? In sandbox below I found wrapping the Backdrop into a Grid and then setting the zindex on the parent/Grid works. Here's various setups of Backgrounds with Drawers and Dialogs :
https://codesandbox.io/s/romantic-firefly-44s63k?file=/src/temporary-drawer.js
https://mui.com/material-ui/api/dialog/
https://mui.com/material-ui/api/modal/

React JS - Toggle drawer and resize not working together in Material UI

I'm trying to do toggle drawer and resize of it together using React JS and Material UI. The reference code is in class based component at
https://stackblitz.com/edit/react-2h1g6x?file=ResponsiveDrawer.js
I'm trying to do similarly using function based components and hooks and the codesandbox link is below:
https://codesandbox.io/s/resizeeee-ilot8?file=/src/App.js
But this is not working properly. Initially on toggle the drawer expands and on toggle again it collapses which is fine. But the issue starts when I toggle the drawer and trying to resize it. The width of the drawer changes continuously with mousemove on both outside of drawer and inside of drawer. I understood that my state is changing continuously and so mousemove. Is there any way to restrict this and let it work similarly to the class based component. Any help is much appreciated. Thanks!
Change condition on line number 97
if (!state.isResizing || !open)
just change "&&" to "||"

React-Bootstrap OverlayTrigger not working when overlay is something other than a ToolTip or Popover

The documentation for the react-bootstrap overlay trigger says that the overlay prop can be an element or text. However, whenever I pass it something other than a "Tooltip" component it doesn't work. In fact, if you modify their code example on the website linked below to be just a div instead of a Tooltip or a string, it doesn't work on their site either. Does it have to be passed a Tooltip?
https://react-bootstrap.github.io/components.html#tooltips-overlay-trigger
Easiest thing to pass is a Tooltip or a Popover.
You could also pass it something else, but then you have to wrap it in an Overlay instead of an OverlayTrigger. See the react-bootstrap docs on Custom Overlays for more specific examples.

ReactJS with material-ui is it possible to have the tooltip behaviour on hover of a div?

I was wondering if the tooltip like this:
tooltip from material-ui
that occurs on icon can be possible onHover of a div?
Or do I have to create it by hand?
I tried this:
tooltip div with reactjs
but none of the 2 solutions is currently working.
can be possible onHover of a div? Or do I have to create it by hand?
You have to create it of course. It is unclear what you mean by onHover, if you want you can use onMouseEnter and onMouseLeave to create relatively positioned tooltip.
Alternatively it is super simple to use a simple CSS tooltip : http://kushagragour.in/lab/hint/ driven by data- attributes (supported natively by react).

Resources