DEV Community

Discussion on: Suppressing Svelte transitions with the #each hack

Collapse
 
opensas profile image
opensas

Very clever indeed, I faced exactly the same problem (a list, with options to sort and filter items) anf finally supressed the transition.
Still, it feels a bit hacky, I wonder if there isn't a cleaner approach. SOme way to suspend a transition depending on a specific condition.

Collapse
 
dimfeld profile image
Daniel Imfeld • Edited

I've played around with conditional transitions a bit but haven't yet come up with anything that actually works. Next thing I'm going to try is some sort of wrapper function around a transition that can evaluate a function or something to decide to run a transition or not.

Not sure if it'll work but I'll definitely write about it if it does :). If you do come up with something I'd love to hear it!