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

show / hide not working in riot 3 #2156

Closed
sourcegr opened this issue Dec 14, 2016 · 4 comments
Closed

show / hide not working in riot 3 #2156

sourcegr opened this issue Dec 14, 2016 · 4 comments
Labels

Comments

@sourcegr
Copy link
Contributor

@sourcegr sourcegr commented Dec 14, 2016

The show/hide={conditional} does not work as expected in Riot or am I missing something?

If the display:'' or display:'none' is not removed from the style of the element, then there is no way to show/hide an element depending on a variable value. The if is not an option, because it removes the element from the dom.

  1. Can you reproduce the issue?
    http://plnkr.co/edit/jcN4ZzzWRvSEffuTpfUl?p=preview
  • Question
  • Discussion
  • Feature request
@dranzd
Copy link

@dranzd dranzd commented Dec 14, 2016

Is adding a class hidden (or any class name) on H1 works for you? Like this one here:
http://plnkr.co/edit/Wxs30MG1FW2nd37UepvV?p=preview

@sourcegr
Copy link
Contributor Author

@sourcegr sourcegr commented Dec 14, 2016

Hello @dranzd and thanks for the time you took to look it up!

Of cource it does and this is the way I currently accomplish what I want, but it is a workaround, irrelevant to the issue :)

Thanks again!

@GianlucaGuarini
Copy link
Member

@GianlucaGuarini GianlucaGuarini commented Dec 14, 2016

@papas-source thanks for reporting it

@dranzd
Copy link

@dranzd dranzd commented Dec 14, 2016

@papas-source I'm new to RiotJS and just started using it like a week ago. Was curious about where in the documentation I can find that hide/show conditional you mentioned. I just found it. I've tested and confirmed that it indeed does not work as you reported :).

Thanks, just found new way to hide/show elements (once it works again).

GianlucaGuarini added a commit that referenced this issue Dec 14, 2016
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.