Skip to content

Commit 668f815

Browse files
committed
Added clarification to phx-remove to explain a surprising behavior
1 parent 26acd30 commit 668f815

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

guides/client/bindings.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ may be specified, which can contain a `Phoenix.LiveView.JS` command to execute.
353353
The `phx-remove` command is only executed for the removed parent element.
354354
It does not cascade to children.
355355

356+
Note that it's recommended that for `phx-remove` to work correctly, the parent
357+
element should have a (unique) DOM ID. If it don't have one, it may not fire.
358+
356359
To react to elements being updated in the DOM, you'll need to use a
357360
[hook](js-interop.md#client-hooks-via-phx-hook), which gives you full access
358361
to the element life-cycle.

0 commit comments

Comments
 (0)