ManuelDeLeon / viewmodel

MVVM for Meteor
https://viewmodel.org
MIT License
205 stars 23 forks source link

default display state of nodes that have if\unless #277

Open avalanche1 opened 8 years ago

avalanche1 commented 8 years ago

I stumbled into an issue where nodes that have if\unless bindings when their default value is false\true (respectively for if\unless) or binded method evaluates to false\true - they flash briefly before being hidden (depending on browser, cpu performance, etc). In such cases I had to opt out for Blaze '#if' which doesnt render the node at all. I suggest that all nodes that have if\unlessbindings have dispay: none by default to prevent this.

hluz commented 8 years ago

There is really no need to fallback to Blaze #if due to this. Adding style="display:none;" to the element's attribute list works fine...

avalanche1 commented 8 years ago

Are you kidding?

hluz commented 8 years ago

Does it sound like?

avalanche1 commented 8 years ago

Sounds inconvenient and anti-DRY if you're serious.

ManuelDeLeon commented 8 years ago

I need to check on this because I was pretty sure if a property had a default of false then the flash wouldn't occur.