Migrating ui-sortable / ng-sortable / dragula to modern Angular
ui-sortable wrapped jQuery UI Sortable in a directive bound to ng-model.
What replaces it
| Option | When to choose it |
|---|---|
| Angular CDK Drag and Drop | Sortable lists, transfer between lists and free dragging, without jQuery UI. |
How to migrate it
- Replace the directive with cdkDropList and cdkDrag on the list and its items.
- Update the array in the drop event with moveItemInArray or transferArrayItem.
- Remove jQuery UI once the last sortable list is migrated.
Watch out. ui-sortable is often the only reason jQuery UI is still in the bundle. Removing it is a visible win in load time.
Other libraries
Planning a migration or a micro-frontend platform?
In a 20-minute call you describe your situation and I tell you how I'd approach it. If it isn't worth doing yet, I'll say so.
Message me on LinkedIn