johnny / jquery-sortable

A flexible, opinionated sorting plugin for jQuery
http://johnny.github.io/jquery-sortable/
Other
1.52k stars 441 forks source link

Not compatible with jquery 3.3.0+ #291

Open bitno2u opened 1 year ago

bitno2u commented 1 year ago

Draggable list elements only can be put at the bottom of the list. They can not be dragged inside any connected lists placed on right, bellow or diagonally. Can you fix this?

bitno2u commented 1 year ago

Ad-hoc solution: Change jquery 3.3.x file instead
(offsetParent === doc.body || offsetParent === doc.documentElement) && insert
(offsetParent !== doc && offsetParent !== doc.body && offsetParent !== doc.documentElement) &&

For morde details look https://github.com/jquery/jquery/pull/3887/commits/5e7e4d7382224dfbc8e348796439c002013b4191#diff-62d55137fbe4b552f5a996d0af19023a42aeed89686647e7b4e4026fd1a66186

bitno2u commented 1 year ago

Better solution: Change jquery-sortable.js

instead if (el.css("position") === "relative" || el.css("position") === "absolute" || el.css("position") === "fixed") insert if (el.css("position") === "relative" || el.css("position") === "absolute" || el.css("position") === "fixed" || el.css("position") === "static")

venkatt05 commented 1 year ago

@bitno2u They can not be dragged inside any connected lists placed on right, bellow or diagonally - I was trying to replicate this issue with my project but couldn't do it. Could you please help with some more detail.

bitno2u commented 1 year ago

Download jquery-sortable.js v0.9.13 and add "static" as an option for el.css("position"), as described before.

venkatt05 commented 1 year ago

Yes, I got that part. I wanted to reproduce the issue in my system. I was using the 0.9.13 and jQuery 3.3.1, but I can't able to replicate the issue reported here. Is this issue happening is any specific scenario ?

ryanb commented 1 year ago

I ran into this issue as well. For me it only affects sorting within tables. I tried adding el.css("position") === "static" as recommended above which does help, but there's still considerable offset on the sorting. I ended up changing the table to divs to work around this.