daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.02k stars 617 forks source link

How to disable ables on moveable instance? #968

Open ivadenis opened 1 year ago

ivadenis commented 1 year ago

Environments

Description

I'm trying to programmatically disable ables (draggable, resizable, etc) on the moveable instance. How to achieve that?

I tried:

moveable.draggable = false;
moveable.setState({ draggable: false });

I'm also using individualGroupable and individualGroupableProps.

daybrush commented 1 year ago

sorry. Since Moveable pass the props directly, there is no state.

use it like this:

const [draggable, setDraggable] = useState();

<Moveable
    draggable={draggable} />