show / hide not working in riot 3 #2156

papas-source opened this Issue Dec 14, 2016 · 4 comments


None yet

3 participants

papas-source commented Dec 14, 2016 edited

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?
  • Question
  • Discussion
  • Feature request
dranzd commented Dec 14, 2016

Is adding a class hidden (or any class name) on H1 works for you? Like this one here:


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!


@papas-source thanks for reporting it

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 GianlucaGuarini added a commit that closed this issue Dec 14, 2016
@GianlucaGuarini GianlucaGuarini closes #2156 0d52475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment