How to create a resizable and movable div in wrapper div in react.js?

39 Views Asked by At

This is what I need: enter image description here

enter image description here

So, this lightblue div needs to be:

  • resizable (on the left and right side, cannot resize over lightgray wrapper div width), and
  • movable inside lightgray wrapper div (cannot overflow its sides).

On his sides, lightblue div needs to have cursor: ew-resize; and inside needs to be cursor: grab.

I tried so many things but I didnt success to do both functionalities, I have separately resizing and moving... Also, I don't use any library for it.

How to achieve that in js and react.js?

Please help if someone know!

0

There are 0 best solutions below