PDA

View Full Version : Resizable textarea moving around page after scroll



mattdaw
22 Jan 2007, 3:02 PM
Howdy folks, I'm running into a problem using a Resizable textarea. After scrolling down, if I shrink the textarea, the div & textarea move up in Y.

I've done some digging and it appears that the call to "this.proxy.getBox()" is returning varying y coords as I scroll. And thus the "this.el.setBox()" call moves the div. Any idea why this would be the case? And just generally, why does the Resizable touch the positioning of the div, couldn't it just update the height and width?

Thanks!

jack.slocum
22 Jan 2007, 4:31 PM
The reason it updates XY (in some cases) is for north/west resizing. However, when it's just a standard resize, it shouldn't adjust the XY. This was an old bug that fixed, that somehow made it back into the refactor. I have corrected it in my local code, and it will be fixed in the next release.

Here's the relevent code in case you want to patch it in:

In the constructor:


if(this.handles.indexOf('n') != -1 || this.handles.indexOf('w') != -1){
this.updateBox = true;
}

In resizeElement:

var box = this.proxy.getBox();
if(this.updateBox){
this.el.setBox(box, false, this.animate, this.duration, null, this.easing);
}else{
this.el.setSize(box.width, box.height, this.animate, this.duration, null, this.easing);
}

Please let me know if this corrects your problem.

mattdaw
22 Jan 2007, 5:14 PM
Hi Jack, that works now, thanks! Any idea why the getBox call would be returning varying y coordinates after scrolling? The resizable is inside a td, does that mess with the positioning code?