Bug Tracker

Opened 12 years ago

Closed 11 years ago

#2762 closed bug (fixed)

.ui-sortable-placeholder width not updated on rearrange in ui.sortable.js

Reported by: mmohrman Owned by: brandon
Priority: minor Milestone: 1.2.3
Component: dimensions Version: 1.2.3
Keywords: Cc:
Blocked by: Blocking:

Description

When sorting an unordered list, the width for the placerholder element, .ui-sortable-placeholder, is not updated. So, for example, if you move an outermost list item inward (to be the child of a sibling list item), the placeholder div stretches beyond the root list.

Fix:

Change

if(this.placeholderElement) this.placeholder.css(this.placeholderElement.offset());

To

if(this.placeholderElement) this.placeholder.css(this.placeholderElement.offset()).css({ width: this.placeholderElement.outerWidth() });

On ~line 485 in ui.sortable.js

Thank you.

Change History (5)

comment:1 Changed 12 years ago by paul

Resolution: fixed
Status: newclosed

comment:2 Changed 12 years ago by mmohrman

Resolution: fixed
Status: closedreopened

this.placeholderElement.is(":visible") returns false, so the implemented solution is never executed.

comment:3 Changed 12 years ago by mmohrman

Removing

&& this.placeholderElement.is(":visible")

or using

this.placeholder.is(":visible")

instead appear to be acceptable solutions.

comment:4 Changed 12 years ago by paul

Component: uidimensions
Owner: changed from paul to brandon
Status: reopenednew

This wouldn't work, because outerHeight reports a wrong result when the visibility of a element or parent is set to hidden. Brandon, any idea?

comment:5 Changed 11 years ago by brandon

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.