phoenixframework / phoenix_live_view

Rich, real-time user experiences with server-rendered HTML
https://hex.pm/packages/phoenix_live_view
MIT License
6.18k stars 930 forks source link

LiveComponent disappears when it handles a click that updates it's state #843

Closed axelson closed 4 years ago

axelson commented 4 years ago

Environment

Actual behavior

A LiveComponent that has a sub-render function with it's own ~L and phx-click disappears when the component handles a phx-click that updates it's socket state. (possibly related to svg elements)

Full reproduction steps are in the repo: https://github.com/axelson/reproduce_live_view_dissapearing

Link to most relevant code: https://github.com/axelson/reproduce_live_view_dissapearing/commit/3d958a26ce1708b26acd5de5f0087718f7058d96

Expected behavior

The "menu" component should continue to be displayed

Or if I'm making some sort of LiveView implementation error, a relevant warning should be displayed.

"workarounds"

If I do either of these then the bug doesn't manifest:

chrismccord commented 4 years ago

This was a bug on the morphdom side and has been fixed on master. It only applies to SVG elements. Thanks for the report and keep an eye out for a new morphdom release!

axelson commented 4 years ago

Thanks for looking into/fixing it! Will look forward to the next morphdom release.