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

phx-hook doesn't get triggered #722

Closed seb3s closed 4 years ago

seb3s commented 4 years ago

Environment

Actual behavior

phx-hook doesn't get triggered on morphdom updates when sharing a similar dom structure

Expected behavior

should be triggered ;-)

chrismccord commented 4 years ago

Can you provide a minimal example project that recreates your issue? We need more information to be able to help here :)

seb3s commented 4 years ago

Yes, I've submitted a bit to quickly ;-) I was missing some ids on the nodes that have the phx-hook as specified in the documentation. It gets properly triggered when I added these ids. At first it functions without the ids when the dom structure is not the same, so that's the reason why I get confused.