show / hide not working in riot 3 #2156

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

Projects

None yet

3 participants

@papas-source
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?
    http://plnkr.co/edit/jcN4ZzzWRvSEffuTpfUl?p=preview
  • Question
  • Discussion
  • Feature request
@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

@papas-source

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
Member

@papas-source thanks for reporting it

@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 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