phoenixframework / phoenix_live_view

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

Fix form recovery when targeting LiveComponents #3317

Closed SteffenDE closed 3 months ago

SteffenDE commented 3 months ago

In #3201 we changed the way form recovery works by using a document fragment to dispatch the form recovery events. When traversing the DOM to check if a LC is in the same LiveView, this broke the check, because when iterating over node.parentNode, we would never arrive at the fragment itself. This commit fixes this by checking by using the framgnet's first child instead, which is the actual LV element.

Fixes #3314.

tmjoen commented 3 months ago

This fixes my app — thanks so much!

chrismccord commented 3 months ago

❤️❤️❤️🐥🔥