jrief / django-admin-sortable2

Generic drag-and-drop ordering for objects in the Django admin interface
https://django-admin-sortable2.readthedocs.io/en/latest/
Other
770 stars 180 forks source link

Still unhandled promise rejection in adminsortable.min.js in Safari #328

Closed christianwgd closed 2 years ago

christianwgd commented 2 years ago

Hi, sorry to open that old issue #313.

The minified version of adminsortable.js is still not working. I'm on MacOS 12.5.1 (ARM/M1) using Django 4.1., Safari 15.6.1

Firefox and Chrome is ok, no error.

What I've tried so far:

Still no luck, i got stuck with the error "Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 't.oldIndex')".

The only thing that works is copying the unminified file over the minified (adminsortable2.js to adminsortable2.min.js)

Any idea why Safari is not working correctly?

jrief commented 2 years ago

Since I can not reproduce this error, could you please do me a favor.

Install terser and minify adminsortable2.js using that library. If that works for you, I'll change the build chain.

christianwgd commented 2 years ago

I have tested some further scenarios: Deploying my apps with django-adminsortable2 to an Ubuntu Server (22.04) brings the same result: Works fine in Firefox and Chrome (MacOS) but not in Safari. From a windows client this is also true (not able to test safari there).

Will try the terser app the next days. Thanks for bothering...

christianwgd commented 2 years ago

Oh, that was easy. Created a new minified file with

terser --compress -- adminsortable2.js > adminsortable2.min.js

Works on all browser I've tried so far. Seem like - fingers crossed - a solution for the problem even in Mac Safari.

jrief commented 2 years ago

Version 2.1.3 contains this patch.