I’ve built a reorder function that comes with a smooth animation, and it works pretty well. However, I’m facing an issue with the gap between the items. I want to have a consistent gap of 10px horizontally and vertically, but while the vertical gap is perfect, the horizontal gap is not behaving as expected.
Any suggestions or optimizations for fixing the horizontal gap would be greatly appreciated!
Details:
The vertical gap is fine and works as expected.
I am using position: absolute for the items.
The gap between items is defined as 10px in the layout.
Thanks in advance for your help!
The code : https://stackblitz.com/edit/plain-html-la5wdv?file=index.ts,index.html,style.css