Skip to content
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

removeElement doesn't remove all elements #157

Open
richardklingler opened this issue Jan 4, 2022 · 3 comments
Open

removeElement doesn't remove all elements #157

richardklingler opened this issue Jan 4, 2022 · 3 comments

Comments

@richardklingler
Copy link

Something weird here happening....

I use ajax to load items on a second board when I click on an item in the first board...all fine....

For the next click in the first board I use getBoardElements(id) and walk through the array to remove all items with removeElement()....like:

var allEle = kanban1.getBoardElements("_working"); console.log("Number of elements: " + allEle.length); allEle.forEach(function(item, index) { kanban1.removeElement(item); console.log('Removed...', item); });
In the console the number of elements is logged correctly in my test as 8....but the iteration is only run 4 times...so leaving back 4 items not being deleted...

From the 8 items before on the second board all even number positions were deleted...so leaving back position 1, 3, 5 and 7....

remove_items

@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/riktar/jkanban

@richardklingler
Copy link
Author

Some further testing showed:

When a board contains 8 items....

  1. delete removes half of them, leaving 4 items
  2. delete removes again half of them, leaving 2 items
  3. delete again only deletes half, leaving 1 item
  4. delete removes the last one...

@marcosrocha85
Copy link
Contributor

Hello @richardklingler, thank you for using jKanban. Can you provide a jsfiddle so we can test it out? I'm seeing everything fine at latest version here in my machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants