Opened 14 years ago

Closed 6 years ago

#4579 closed bug (notabug)

Sortable: Connected sortables with helpers overrides style sheet display values

Reported by: GimpArm Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.sortable Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:


When dragging an item from one sortable to another using a helper the display property retains its original value even though the display is set by the style class hierarchy.

I would expect this to be a problem with anything that does "jQuery.hide() -> move element ->" as hide() and show() store the old display property then store it, although I don't know why it stores the display value that comes from a style class. Maybe this should be fixed in the jQuery core.

I set up a demo at:

When no helper is specified the behavior is as expected.

Change History (6)

comment:1 Changed 14 years ago by Jörn Zaefferer

Milestone: TBD1.8

comment:2 Changed 11 years ago by wedgwood

it seems not only display values of style. width, height value is aslo changed by sortable plugin internally to fit the original element.

comment:3 Changed 10 years ago by Scott González


comment:4 Changed 10 years ago by petersendidit

Status: newopen
Summary: Connected sortables with helpers overrides style sheet display valuesSortable: Connected sortables with helpers overrides style sheet display values

comment:5 Changed 10 years ago by tj.vantoll

The height and width styles are handled by #4345.

Sortable does preserve the display property originally declared in CSS. What it does not do is handle two lists that have different display property values. But if you have connected lists you're almost going to want them to have the same display property value. Can anybody think of any use cases of different displays (block / inline-block / inline)?

I'm leaning towards the being something that we don't support. This would be tricky to implement, I can't think of any real use cases where this would be useful, and it's easy to workaround. If you really need it !important can be used ( or you can restore the style manually in a stop event.

comment:6 Changed 6 years ago by Scott González

Resolution: notabug
Status: openclosed

This is a jQuery Core bug, not a jQuery UI bug. As of jQuery 3.0.0, this works as expected.

Note: See TracTickets for help on using tickets.