-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addElement API function doesn't insert at desired position #147
Comments
Thanks for opening a new issue. The team has been notified and will review it as soon as possible. |
I tried to reproduce your issue, but it worked fine locally. I noticed that https://cdn.jsdelivr.net/npm/[email protected]/dist/jkanban.js is using "appendChild" instead of "insertBefore". Maybe that version is not properly compiled. @riktar can you confirm that latest dist files are correct? |
BTW. To return draggedItem to the original position on sourceBoard (if user clicked Cancel drag button) I need to determine draggedItem index on the sourceBoard. For today I use the following code:
Is that piece of code fine or may there are some optimizations/shortcuts (I'm not so familiar with jKanban API yet)? |
As jKanban uses and manipulates DOM elements. You can use:
But for instance that is the best way to get an element position from a board. 🙁 |
Just tested with dist\jkanban.min.css and dist\jkanban.min.js files from this repo and they work as expected. Looks like to jsdelivr files really incorrect. @riktar looks like jsdelivr files reupload is needed.. Thank you in advance. |
Hello.
According to docs
addElement
API function adds element in the board with ID boardID, element is the standard format. If position is set, inserts at position starting from 0.I've tried the following code but element still insterted at the very bottom:
Sample application - https://jsfiddle.net/bairog/wtha2d3f/79/
Is that a bug or there is a mistake in my code?
Thank you in advance.
The text was updated successfully, but these errors were encountered: