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

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

Closed
jkirkwood opened this issue Nov 24, 2016 · 2 comments
Closed
Labels

Comments

@jkirkwood
Copy link

@jkirkwood jkirkwood commented Nov 24, 2016

  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 Toggling conditional of `data-is` tag creates new reference in parents `tag` array Toggling `if` of `data-is` tag creates new reference in parents `tags` object Nov 24, 2016
@jkirkwood jkirkwood changed the title Toggling `if` of `data-is` tag creates new reference in parents `tags` object Toggling 'if' of 'data-is' tag creates new reference in parents 'tags' object Nov 24, 2016
@cognitom
Copy link
Member

@cognitom cognitom commented Nov 25, 2016

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
Copy link
Member

@GianlucaGuarini GianlucaGuarini commented Nov 26, 2016

@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 added a commit that referenced this issue Nov 26, 2016
* bug/2089:
  closes #2089
  wip: trying to fix 2089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.