phoenix_live_view icon indicating copy to clipboard operation
phoenix_live_view copied to clipboard

pass fromEl and toEl to hook beforeUpdate

Open SteffenDE opened this issue 1 year ago • 3 comments

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 avatar Jan 05 '25 12:01 SteffenDE

@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 avatar Apr 21 '25 17:04 probably-not

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

SteffenDE avatar Apr 22 '25 16:04 SteffenDE

Thanks @SteffenDE! I'll try it out from the branch and see how things are working 🙏

probably-not avatar Apr 23 '25 05:04 probably-not