-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Action's parameters are not being passed correctly #5173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actions only support a single parameter, which can be an object if you want to pass multiple things see the docs |
I see, it used to work differently in 3.12.1 and then maybe in this case the log should show |
@yuliankarapetkov I agree it should show @antony I would classify this as a breaking change, as we had code using 3.12.1 w/ multiple params that no longer works. And in the changelog for 3.13.0 (when this change seemed to have been made), there isn't anything about this change. It would be helpful to have a small note about this in the changelog. Thanks! 🙏 |
If something is undocumented and unintentional, it's subject to change without us noticing, so it's difficult to make a changelog for something which wasn't supported, and for something which we weren't aware of the current behaviour, if that makes sense? The behaviour is now according to the docs, and documented accordingly, any former behaviour was simply as-was. The same applies for the parameter ordering, we only support passing a single parameter, so therefore that behaviour is documented, tested, and works as described - if you call methods with invalid signatures, then invalid behaviour may well occur. |
Multiple parameters working was a bug and we have fixed that now.
No, the current behaviour is expected. The argument you provide to an action is an expression that is passed as the second parameter to the action function: <div use:fn={1, 2, 3} /> Is actually doing this: fn(
node,
(1, 2, 3)
) Evaluating the expression |
We agreed to rephrase a bit to clarify that actions can have just one parameter (although the signature is correct), re-opening. |
This came up initially in #3923 - That it worked with multiple parameters before 3.13.0 was an accident and never an intended behavior. |
Describe the bug
When you pass a list of parameters to an action, only the last parameter in the list is being received by the function. What's more, the parameter is being "moved" to the first position.
This used to work in 3.12.1 but it doesn't work in 3.24.0
To Reproduce
Open the this REPL and see the logs. Compare the logs with that one.
Expected behavior
Parameters should be passed correctly.
The text was updated successfully, but these errors were encountered: