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
The text was updated successfully, but these errors were encountered:
masenf
changed the title
rx.form handle_submit lambda cannot reference foreach vars
[REF-2745] rx.form handle_submit lambda cannot reference foreach vars
May 1, 2024
Describe the bug
When rendering a form inside an
rx.foreach
, the value and index of the loop are not available to anon_submit
lambda function.To Reproduce
Expected behavior
The event handler is called with the appropriate loop index.
Instead I get a frontend error.
Screenshots
The following JS is generated
As you can see, the
index
var is out of scope in the externalizedhandleSubmit_a38fe166b30dfd298368c2a885298234
callback.Specifics (please complete the following information):
main
Workaround
Creating an
rx.el.input(type="hidden")
and pass the value via theform_data
does work, but it's less clean.From SyncLinear.com | REF-2745
The text was updated successfully, but these errors were encountered: