Ticket #3067 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

Resizeable and containment works incorrectly

Reported by: tjerkw@… Owned by: eduardo
Priority: major Milestone: 1.7
Component: ui.resizable Version: 1.5.1
Keywords: containment out of bounds Cc:
Blocking: Blocked by:


When using the resizable ui behaviour like this:

var options={
			containmentFix:this.getDayNode(), handles:"n,s",

(where getDayNode and onchange are specified).

Then the resizeable will resize out of the containment element if there are enough other elements above the contianment elements.

I craeted my own fix, but i dont think this fix is the correct fix for everyone.

I craeted my own containmentFix plugin add like this:

$.ui.plugin.add("resizable", "containmentFix", {

Where all checks for (co.helper ? A : B) where simplified to A.

For example the resize method has the following code:

if (cp.top < (co.top)) {
			self.size.height = self.size.height + (self.position.top - co.top);
			if (pRatio) self.size.width = self.size.height / o.aspectRatio;
			self.position.top = co.top;

The current code base is like this:

if (cp.top < (o.helper ? co.top : 0)) {

			self.size.height = self.size.height + (o.helper ? (self.position.top - co.top) : self.position.top);

			if (pRatio) self.size.width = self.size.height / o.aspectRatio;

			self.position.top = o.helper ? co.top : 0;


Hope this gives you enough information to fix this bug. Or maybe i must specify a helper in my options?

I dont know, this was at least awkward enough to file this bug.

Change History

comment:1 Changed 6 years ago by paul

  • Milestone changed from 1.5.2 to 1.6b

comment:2 Changed 6 years ago by Cloudream

  • Milestone changed from 1.6b to 1.6

comment:3 Changed 5 years ago by eduardo

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.