Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10083 closed bug (duplicate)

if sortable is initially created without items, it will always be considered vertical despite what options.axis is set to

Reported by: lukepage Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.10.4
Keywords: Cc:
Blocked by: Blocking:

Description

This code

https://github.com/jquery/jquery-ui/blob/master/ui/sortable.js#L89

Let's determine if the items are being displayed horizontally

this.floating = this.items.length ? o.axis === "x"
this._isFloating(this.items[0].item) : false;

should be

Let's determine if the items are being displayed horizontally

this.floating = o.axis === "x"
(this.items.length ? this._isFloating(this.items[0].item) : false);

otherwise it is impossible to override the axis if sortable is started without matching items

Change History (6)

comment:1 Changed 9 years ago by tj.vantoll

Resolution: duplicate
Status: newclosed

Duplicate of #7498.

comment:2 Changed 9 years ago by lukepage

Its not really a duplicate..

If #7498 is fixed then it will not necessarily fix this bug - e.g. someone using inline-block elements will still need to use the axis option, which is ignored because of the above line of code.

If I was going to fix #7498 it wouldn't necessarily depending on its implmentation fix this.

I was going to submit a pull request? Should I still bother or will it be closed because it doesn't fix the bug you've marked as this being a duplicate of?

comment:3 in reply to:  2 Changed 9 years ago by tj.vantoll

Resolution: duplicate
Status: closedreopened

comment:4 Changed 9 years ago by tj.vantoll

Resolution: duplicate
Status: reopenedclosed

Duplicate of #9443.

comment:5 Changed 9 years ago by tj.vantoll

lukepage,

Ah ok. This is more accurately a duplicate of #9443, which already has a pull request that I believe addresses your concern (https://github.com/jquery/jquery-ui/pull/1035).

comment:6 Changed 9 years ago by gentooboontoo

I would be glad if the #9443 bug fix is finally merged. I could rebase my PR if needed.

Note: See TracTickets for help on using tickets.