Toggling 'if' of 'data-is' tag creates new reference in parents 'tags' object #2089

Closed
jkirkwood opened this Issue Nov 24, 2016 · 2 comments

Projects

None yet

3 participants

@jkirkwood
  1. Describe your issue:

I have a child tag mounted inside of a parent tag using the data-is attribute. I am also using the if attribute on the child tag to toggle visibility. Even when the child is not visible it still has a reference in the parents this.tags object. Whenever I toggle the visibility of the child, additional references are created for the child in the parent's this.tags object.

Everything seems to work ok if I mount the child tag normally (via its tag name instead of using the data-is attribute).

  1. Can you reproduce the issue?
    https://jsfiddle.net/vgubuqs3/

In this example the child tag is mounted via the normal tag syntax. Everything works fine:
https://jsfiddle.net/60ekr3ms/

  1. On which browser/OS does the issue appear?
    Chrome 54.0.2840.98 / OS X 10.12.1

  2. Which version of Riot does it affect?
    3.0.0

  3. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@jkirkwood jkirkwood changed the title from Toggling conditional of `data-is` tag creates new reference in parents `tag` array to Toggling `if` of `data-is` tag creates new reference in parents `tags` object Nov 24, 2016
@jkirkwood jkirkwood changed the title from Toggling `if` of `data-is` tag creates new reference in parents `tags` object to Toggling 'if' of 'data-is' tag creates new reference in parents 'tags' object Nov 24, 2016
@cognitom
Member

At this line tagName is supposed to be another-tag, but div actually, I think.
https://github.com/riot/riot/blob/v3.0.0/lib/browser/tag/tag.js#L288

@GianlucaGuarini
Member

@rogueg could you help me on this issue please? I have created a branch to solve the problem https://github.com/riot/riot/tree/bug/2089 but I still don't get what's wrong

@GianlucaGuarini GianlucaGuarini added a commit that referenced this issue Nov 26, 2016
@GianlucaGuarini GianlucaGuarini Merge branch 'bug/2089' into dev
* bug/2089:
  closes #2089
  wip: trying to fix 2089
e90c400
@GianlucaGuarini GianlucaGuarini added a commit that closed this issue Nov 26, 2016
@GianlucaGuarini GianlucaGuarini closes #2089 80cea18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment