You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 10, 2026. It is now read-only.
I've encountered an issue where events from a LiveViewNative.LiveComponent are being routed to the parent LiveView instead of being handled by the component itself, despite using phx-target={@myself} in the component template.
Steps to reproduce:
Create a LiveViewNative.LiveComponent with an event handler
Add a button with phx-click and phx-target={@myself}
Implement the corresponding handle_event/3 function in the component
Observe that the event is sent to the parent LiveView instead of being handled by the component
I've encountered an issue where events from a LiveViewNative.LiveComponent are being routed to the parent LiveView instead of being handled by the component itself, despite using
phx-target={@myself}in the component template.Steps to reproduce:
phx-clickandphx-target={@myself}handle_event/3function in the componentCode example:
Expected behavior:
The
handle_event/3function in the component should receive and handle the "increment" event.Actual behavior:
The event is routed to the parent LiveView
This behavior differs from standard Phoenix LiveView where
phx-target={@myself}correctly routes events to the component's handler.Environment: