AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
829 stars 313 forks source link

Fix sortable elements #2750

Closed tvdeyen closed 6 months ago

tvdeyen commented 6 months ago

What is this pull request for?

1. Fix sorting of nested elements of freshly created elements Make sure that nested elements of all elements get initialized as sortable after being created, not just fixed.

2. Avoid sending sort events twice SortableJS sends two events if you drag an element from one nesteable elements container to another. Leading to incrementing the target lists positions to high.

Since acts_as_list maintains both lists correctly we can simply suppress the second event on the source list.

Checklist

alchemycms-bot commented 6 months ago

💚 All backports created successfully

Status Branch Result
✅ 7.1-stable

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details