question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

addElement API function doesn't insert at desired position

See original GitHub issue

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:

KanbanTest.addElement(sourceBoardId, {
        id: itemId,
        title: itemText
    }, 1);

123 Sample application - https://jsfiddle.net/bairog/wtha2d3f/79/

Is that a bug or there is a mistake in my code? Thank you in advance.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bairogcommented, Oct 18, 2021

I tried to reproduce your issue, but it worked fine locally. I noticed that https://cdn.jsdelivr.net/npm/jkanban@1.3.1/dist/jkanban.js is using “appendChild” instead of “insertBefore”. Maybe that version is not properly compiled.

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.

1reaction
marcosrocha85commented, Oct 13, 2021

I tried to reproduce your issue, but it worked fine locally. I noticed that https://cdn.jsdelivr.net/npm/jkanban@1.3.1/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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to insert an element after another element in JavaScript ...
insertAdjacentElement (position, newElem) lets you reference any element, and insert the to-be moved element ... insertAfter function that doesnt exist.
Read more >
DefaultListModel (Java Platform SE 7 ) - Oracle Help Center
Inserts the specified element at the specified position in this list. void, addElement(E element). Adds the specified component to the end of this...
Read more >
Add a Character to a String at a Given Position - Baeldung
In this quick tutorial, we'll demonstrate how to add a character at any given position in a String in Java.
Read more >
List<T>.Add(T) Method (System.Collections.Generic)
The following example demonstrates how to add, remove, and insert a simple business object in a ... PartName = "" })); // Insert...
Read more >
.after() | jQuery API Documentation
A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert after each element in the set of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found