Skip to main content

Bug Tracker

Side navigation

#2421 closed enhancement (invalid)

Opened February 27, 2008 02:41AM UTC

Closed July 11, 2010 06:37PM UTC

Resizable breaks with %-based positioning but works with pixel-based positioning

Reported by: briang Owned by: braeker
Priority: minor Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: resizable Cc:
Blocked by: Blocking:
Description

I am using resizables to display an object in a Gantt-chart like setup where each resizable object represents some subset of the overall range available. If you consider horizontal sizing only, the left and right edges of the parent are the min and max values and the resizable can represent any subset of that range by dragging the edges.

Initially I attempted to position the left/width of the resizable object using percentages like so:

<div class="package" id="pkg1" style="margin: 5px; padding: 20px; background-color: #eee; left: 15%; width: 40%;">
  <div style="float: left; background-color: #ccc; width: 20%;">Package #1</div>
  <div style="float: left; background-color: #f00; width: 80px;">$250.00</a></div>
</div>

The associated resizable call was:

$(".package").resizable({ handles: 'w, e', autohide: true, minWidth: 10, containment: 'parent'});

This results in bizarre behavior where the resizable is displayed properly at first. However, upon trying to drag either handle results in the left handle snapping back to the left edge of the parent. After that, it behaves properly.

If instead you use pixels:

<div class="package" id="pkg1" style="margin: 5px; padding: 20px; background-color: #eee; left: 167px; width: 236px;">
  <div style="float: left; background-color: #ccc; width: 20%;">Package #1</div>
  <div style="float: left; background-color: #f00; width: 80px;">$250.00</a></div>
</div>

It works as expected including the initial drag. It appears the percentage is miscalculated when the widget is instantiated.

Percentage-based support would be valuable in order to support fluid layouts.

I've confirmed this in both FF 2 and IE 6 on Windows XP.

Attachments (0)
Change History (4)

Changed February 27, 2008 12:52PM UTC by paul comment:1

owner: paulbraeker

Changed May 04, 2008 09:10AM UTC by paul comment:2

priority: majorminor

Changed May 05, 2008 08:56AM UTC by paul comment:3

type: bugenhancement

This is a enhancement, not really a a bug.

Changed July 11, 2010 06:37PM UTC by dmethvin comment:4

resolution: → invalid
status: newclosed

This should be filed in the UI bug tracker if still relevant.

http://dev.jqueryui.com