This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-29
Channels
- # announcements (7)
- # babashka (36)
- # beginners (67)
- # braveandtrue (11)
- # cider (8)
- # clojure (52)
- # clojure-conj (4)
- # clojure-poland (1)
- # clojure-spec (9)
- # clojure-uk (8)
- # clojurescript (42)
- # core-typed (11)
- # cursive (4)
- # emacs (1)
- # fulcro (1)
- # graalvm (24)
- # hoplon (10)
- # hyperfiddle (1)
- # off-topic (30)
- # re-frame (7)
- # reitit (1)
- # sql (1)
Does Hoplon have an event that triggers immediately before a node enters or leaves the DOM?
Why I (think) I need this: I want to animate the filtering of a list, such that nodes that are not changed by the filter are smoothly transitioned to their new positions.
I found the hoplon.observer ns in brew, which adds support for mutation observers, and it does seem like a way to implement this, in combination with requestAnimationFrame. Any insights would be much welcome. 🙏
@mdiin afaik, mutation observers are the only way, hoplon doesn't have its own hooks
Thanks, that makes sense. I was hoping there was a more idiomatic way of doing this with hoplon, though I did suspect there wasn’t.
@mdiin I would recommend the css only approach with hoplon
the hoplon.observer namespace is still under active development, feel free to reach out if you need help
From what I have read, what I want to do is not possible with CSS only, because I need to apply css to new nodes before they are rendered for the first time. Now that I write this, I realise that I used the wrong example before, because maybe CSS transitioning on top and left will be enough to animate the element positions.
@mdiin applying css happens in hoplon before the node is rendered, the css is applied while the element is in memory, before it’s added to the DOM