2

When I use absolutely positioned pseudo elements on a html list, they appear the way they should, Then, when making the list sortable, the pseudo element is recognized as being part of the draggable element.

But how to indicate this pseudo element is the only handle? or.. How to cancel everything but the pseudo element as draggable?

I tried/hoped indicating the pseudo element as handle, but this doesn't work.

$('#test').sortable({
    handle: "::after"
});

I made this fiddle for clarity

Vincent Duprez
  • 3,772
  • 8
  • 36
  • 76
  • 3
    That's not possible. Pseudo elements are part of element content. It could have some dirty hacks, maybe... – A. Wolff Jan 30 '15 at 08:49
  • This is kind of dirty hack but then droppable behaviour can be quite messy to handle: http://jsfiddle.net/cuhsac51/1/ – A. Wolff Jan 30 '15 at 09:12

1 Answers1

1

As reported here:

"You can't manipulate :after, because it's not technically part of the DOM and therefore is inaccessible by any JavaScript."

Link provides some workaround.

Community
  • 1
  • 1
Luca Detomi
  • 5,564
  • 7
  • 52
  • 77