PDA

View Full Version : Possible Bug with resizable when using constrainTo



mxracer
17 Apr 2007, 7:30 AM
I am playing around with a resizable image (that is draggable) and having it constrained to a container element.

If you goto this link: http://www.qwikioffice.com/forum-examples/constrainTo-test.html
you will notice the following:

1.) When the page loads you can drag the image around, and it is constrained to the container (light grey backround).

2.) But if you resize the image and then drag it around the container, you can see that the constraint is tied to the original dimensions of the image.

Is this a possible bug?

I have been able to listen for the resize event and simply call constrainTo again to fix this, but is this the proper way to do it.

jack.slocum
17 Apr 2007, 1:01 PM
constrainTo operates similar to the other constrain functions. If something changes, you have to let it know. There is a post in the forums wih a simple 2-3 liner that sets it to reconstrain on each drag.

art.home.ext
2 Mar 2010, 1:30 PM
[3.0.0 Fix available]
[FIXED-103][3.0.0] DD of Resizable does not listen to constrainTo (http://www.extjs.com/forum/showthread.php?p=370881#post370881)

[REOPEN in 3.1.1]
[OPEN-670] DragDrop constrainTo after container resize (http://www.extjs.com/forum/showthread.php?p=441969#post441969)