Opened 8 years ago

Last modified 8 years ago

#12980 new bug

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!

Change History (1)

comment:1 Changed 8 years ago by tswaters

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

Cheers,

Note: See TracTickets for help on using tickets.