Skip to main content

Search and Top Navigation

#12980 new bug ()

Opened June 03, 2015 03:49AM UTC

Last modified June 03, 2015 05:48AM UTC

Resizable child can go outside containment when margin is in play.

Reported by: tswaters Owned by:
Priority: minor Milestone: none
Component: ui.resizable Version: 1.11.4
Keywords: Cc:
Blocked by: Blocking:
Description

Please see attached jsFiddle: http://jsfiddle.net/ex5hxqx0/

Summary:

When a child element with a margin has containment set to parent, the resize operation can go outside of the parent -- to the tune of the size of the margin.

Expected Results:

Resize operation is blocked.

Actual Results:

Resize is allowed to go outside the bounds of the parent.

Notes

In the attached jsFiddle (http://jsfiddle.net/ex5hxqx0/) you can disable the margin and the resize will be properly contained to the parent element.

It should also be noted that dragging does work as expected here -- when the child has a margin the drag operation is blocked at the edge of the container and the margin of the child is respected. I didn't include that in the test case so as to muddy the waters, but if you replace 'resizable' with 'draggable' in the javascript section, you can see this behaviour.

I will be reviewing the code shorly to see if I can't figure it out and may sign CLA / send pull request if I find anything. Stay tuned!

Attachments (0)
Change History (1)

Changed June 03, 2015 05:48AM UTC by tswaters comment:1

I've submitted a pull request: https://github.com/jquery/jquery-ui/pull/1564

Cheers,