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

Closed
antoinegoutagny opened this Issue Nov 3, 2016 · 3 comments

Projects

None yet

3 participants

@antoinegoutagny
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
@GianlucaGuarini GianlucaGuarini added the bug label Nov 3, 2016
@papas-source

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
Member

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

@papas-source

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

@GianlucaGuarini GianlucaGuarini added a commit that closed this issue Nov 6, 2016
@GianlucaGuarini GianlucaGuarini closes #2054 8163118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment