Opened 9 years ago

Closed 9 years ago

#9347 closed bug (notabug)

Placeholder not specific to each sortable list

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

Description

When multiple sortables are on a page. The last placeholder class that is set on the page is assigned to all sortables on the page. Thus, the placeholder is always of the same class for all sortables on the page. The placeholder class acts as a global variable affecting all sortables.

When a sortable is created with the .sortable() function, it should maintain it's own specific placeholder class. Any following sortables created should not redefine the placeholder class of prior sortables. Thus, sortable lists on the same page could be set up very differently with different styles without having to share the same placeholder style.

Change History (3)

comment:1 Changed 9 years ago by tj.vantoll

Owner: set to jleverett
Status: newpending

Hi jleverett,

I'm not seeing the issue that you're referring to. The specified placeholder is being used only for the widget it was specified for: http://jsfiddle.net/tj_vantoll/46wWG/1/. And if you need placeholders to look different for different sortables that is easily accomplished as well: http://jsfiddle.net/tj_vantoll/46wWG/.

If that does not help could you please alter one of my test cases to show the issue you're seeing?

Thanks.

comment:2 in reply to:  1 Changed 9 years ago by jleverett

Status: pendingnew

Replying to tj.vantoll:

First of all, thank you for your work and response. I appreciate you taking the time to investigate the issue.

I played with your example and I now see the issue. When linking two sortables (using connectWith) an issue arises if each sortable has it's own unique class-name for it's placeholder. When the sortables are set up like this, an item dragged from one sortable to the other will keep it's home list placeholder, and not use the placeholder of the target list.

So the issue is not exactly what I first thought. It is that the sortable being dropped on will take on the placeholder of the sortable being dragged from. This happens when these two sortables use different class names for their placeholders.

I actually had altered the js-fiddle you sent in order to show the issue, but not being familiar with the tool I lost my changes. Hopefully this description has clarified the issue a bit.

In the process of looking at your example, I saw you using css subclasses to make the placeholder styles unique. This is a method that I can use to set the scope of the placeholder for each list based on it's id. This does work, it is just a different way of doing it than I was trying to use. I will keep that way of specifying the placeholder style in mind in the future since it accomplishes the same thing.

Thank you,

Jason

Hi jleverett,

I'm not seeing the issue that you're referring to. The specified placeholder is being used only for the widget it was specified for: http://jsfiddle.net/tj_vantoll/46wWG/1/. And if you need placeholders to look different for different sortables that is easily accomplished as well: http://jsfiddle.net/tj_vantoll/46wWG/.

If that does not help could you please alter one of my test cases to show the issue you're seeing?

Thanks.

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

Resolution: notabug
Status: newclosed

I'd prefer not to add extra logic around this. The events should provide enough opportunity to do any customized scripting that CSS can't handle.

Note: See TracTickets for help on using tickets.