Bug Tracker

Modify

Ticket #2762 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

.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:
Blocking: Blocked by:

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

comment:1 Changed 5 years ago by paul

  • Status changed from new to closed
  • Resolution set to fixed

comment:2 Changed 5 years ago by mmohrman

  • Status changed from closed to reopened
  • Resolution fixed deleted

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

comment:3 Changed 5 years ago by mmohrman

Removing

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

or using

this.placeholder.is(":visible")

instead appear to be acceptable solutions.

comment:4 Changed 5 years ago by paul

  • Owner changed from paul to brandon
  • Status changed from reopened to new
  • Component changed from ui to dimensions

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 4 years ago by brandon

  • Status changed from new to closed
  • Resolution set to fixed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.