[Live Components] [Stimulus] Dispatch an event from stimulus to a parent Live Component: Missing #[LiveArg] arguments #2106
Unanswered
matthieumastadenis
asked this question in
Questions & Answers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to send an event from a child stimulus controller (named
UI--editable
) to a parent Live Component (namedUser:Profile
), by using the following code:This works pretty well actually. Using PHPStorm's debugger I can see that my Profile::saveUserProfileValue() method is called as expected. The only issue being it's called without any argument, despite the use of
#[LiveArg]
attributes.By inspecting the XHR request that is sent with the dev tools, I can confirm that
label
andvalue
arguments are not sent to the server. The whole payload is the following:I suspect the solution may be to use some specific naming for the arguments, so they are considered as "live". But I don't know what I should use exactly. Am I guessing right on this or do I need anything else?
Beta Was this translation helpful? Give feedback.
All reactions