daybrush / moveable

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

How can I set moveable object to auto expand its width to left. #676

Open hayk-front opened 2 years ago

hayk-front commented 2 years ago

Environments

Description

I have a canvas area, which includes REACT-MOVEABLE < SPAN > element, which has < P > child element and I can type-change a text in that P element.

When I set CSS text-align: right, for my inner < p > element or for < span > element, and start typing some text, its size start to increase, but moveable < span > wrapper auto expand its width to right side (because it has auto-generated "transform: translate" when you drag it)), but it should expand to LEFT to get correct 'text-align: right' typing standard.

So I would kindly ask, is there any solution/prop type which can help me in this situation, or I should find a way and write the whole functionality by myself ? Thank you.

daybrush commented 2 years ago

@hayk-front

Probably the most difficult problem in Moveable.

It's hard to fix right now, but someday I'll fix it.

hayk-front commented 2 years ago

@daybrush Thank you for letting me know. OK, I will try to solve the problem in my case. I will share the result later.