daybrush / moveable

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

Moveable box goes beyond bounds when entering/adding text in content editable div #264

Closed iprasadg closed 3 years ago

iprasadg commented 4 years ago

Environments

Description

If I am editing a text in content editable div and suppose the div is at bottom. The container also have bounds. So when the div is at bottom touched to the bounds and if I am entering text the box goes outside of bounds (or say container). I want the box to go towards up side not outside. I know it can be solved with overflow hidden to the container but I can't use that. Is there any other way?

daybrush commented 4 years ago

@iprasadg

I will tell you how to do it in the next release. Thank you :)

iprasadg commented 4 years ago

@daybrush No problem, I will wait !! Thanks for your reply

daybrush commented 4 years ago

@iprasadg

Try code:

    window.addEventListener("keyup", e => {
        moveable.updateRect();
        moveable.request("draggable", { deltaX: 0, deltaY: 0 }, true);
    })