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

Exception thrown when updating a looped array with false condition #2054

Closed
6 tasks
antoinegoutagny opened this issue Nov 3, 2016 · 3 comments
Closed
6 tasks

Comments

@antoinegoutagny
Copy link
Contributor

Help us to manage our issues by answering the following:

  1. Describe your issue:
    Riot throws an exception:
    "Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node."
    on an update when the following conditions are met:
  • A loop over a custom tag
  • there is a if condition on the looped element that evaluates to false
  • the array is changed
  1. Can you reproduce the issue?

http://plnkr.co/edit/wZlGvjdXskHGyn2XHwpO?p=preview

  1. On which browser/OS does the issue appear?

Windows 10: Chrome 54, Firefox 49.0.2, Edge 25

  1. Which version of Riot does it affect?
    reproduced with 2.6.2 and 2.6.5

  2. How would you tag this issue?

  • Question
  • [ x] Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@sourcegr
Copy link
Contributor

sourcegr commented Nov 3, 2016

hello again, same disclaimer apply like my other post

else root.insertBefore(tag.root, tags[i].root) // #1374 some browsers reset selected here

must be made

else !isInStub(tags[i].root) && root.insertBefore(tag.root, tags[i].root) // #1374 some browsers reset selected here

@GianlucaGuarini
Copy link
Member

@papas-source thanks for your hint, it helped me solving the issue

@sourcegr
Copy link
Contributor

sourcegr commented Nov 6, 2016

Glad I could help, your solution is much more elegant :) COvers other cases also which I didnt know existed :)

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

No branches or pull requests

3 participants