Skip to content

Add demo showing breaking case for LiveView content updating and potential fix#11

Merged
giusdp merged 3 commits intogiusdp:mainfrom
mindok:liveview-content-update
May 6, 2025
Merged

Add demo showing breaking case for LiveView content updating and potential fix#11
giusdp merged 3 commits intogiusdp:mainfrom
mindok:liveview-content-update

Conversation

@mindok
Copy link
Contributor

@mindok mindok commented May 6, 2025

This is a small sample showing a breaking case where LiveView creates a DOM update below a LivePane.pane, causing the style attribute of the div implementing the pane to be removed, so the pane no longer renders correctly. Click on one of the items in the bottom pane to see how it all goes bad.

I'll raise an issue separately. I'm pretty sure the pane hook needs to implement updated() to recalc and reapply the style - currently they are only applied on mounted().

@mindok
Copy link
Contributor Author

mindok commented May 6, 2025

The last commit is a potential fix (it does appear to solve issue #12 ), but I'm not great on JS and not sure if this will create memory leaks etc with your wire-up

@mindok mindok changed the title Add demo showing breaking case for LiveView content updating Add demo showing breaking case for LiveView content updating and potential fix May 6, 2025
@giusdp
Copy link
Owner

giusdp commented May 6, 2025

The fix looks pretty good, it just recalculates the style of the element when liveview updates.
Thanks a lot for your contribution!

@giusdp giusdp merged commit 8a4fb5e into giusdp:main May 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants