pass fromEl and toEl to hook beforeUpdate
Relates to https://github.com/phoenixframework/phoenix_live_view/issues/3516. Relates to #3615.
Allowing beforeUpdate to cancel an update by returning false is not implemented, as this would require more complex internal changes.
@SteffenDE what's the status of this PR? I have a package that implements FLIP animations in a hook (LiveFLIP), and having the fromEl and toEl in the beforeUpdate hook callback would be a huge benefit to avoid jittering issues.
@probably-not I wanted to get some feedback from @chrismccord first.. Apart from that I'd need to add some tests. I did not forget about this, so the goal is to release it in LiveView 1.1 if Chris is happy with it.
You can try this change with
{:phoenix_live_view, github: "phoenixframework/phoenix_live_view", branch: "sd-beforeUpdate-assets", override: true}
and let me know if it works for you :)
Thanks @SteffenDE! I'll try it out from the branch and see how things are working 🙏