Opened 14 years ago

Closed 14 years ago

#3621 closed bug (notabug)

placeholder option problem with sortable elements

Reported by: chag Owned by:
Priority: major Milestone: 1.7
Component: ui.sortable Version: 1.6rc2
Keywords: Cc:
Blocked by: Blocking:


The 'placeholder' option doesn't work as it should with sortable object. the placeholder styles do not overwrite the element style.

ex :

		placeholder: "news_elements_empty", 
		revert: true 

css :

.news_elements li {
	background-color: blue;

.news_elements_empty {
	background-color: red;

html :

<ul class="news_elements">

When dragging the li, the empty place to drop it is not red. It's blue. But, if you don't defin a background on the LI, then, you'll see the blue one.

You can also try this with the actual last sortable demo on this page :

Attachments (1)

sortable-ss.png (19.4 KB) - added by alan.castro 14 years ago.
firebug screenshot

Download all attachments as: .zip

Change History (4)

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

Component: ui.coreui.sortable
Milestone: TBD1.6

comment:2 Changed 14 years ago by alan.castro

I looked this issue and saw in firebug that the class .news_elements li overrides the news_elements_empty, so every li inside that ul is going to be blue it doesn't matter which class you put in the li element. I'm attaching a screenshot of firebug.

Changed 14 years ago by alan.castro

Attachment: sortable-ss.png added

firebug screenshot

comment:3 Changed 14 years ago by paul

Resolution: invalid
Status: newclosed

This is not a bug in jQuery UI - it's simply because your CSS for the placeholder is not specific enough, and therefore doesn't overwrite the default style. If you change the rule for the red background to ".news_elements .news_elements_empty", it'll work fine.

Note: See TracTickets for help on using tickets.