-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Form serialize #699
Form serialize #699
Conversation
I'll have time to take a look at this over the weekend |
great, please note my PR testing case for json serialization of |
@acivitillo, I've done a proper rebase with from idom import component, event, html, run
@component
def Form():
@event(prevent_default=True)
def handle_form(event):
print(event["target"]["elements"])
return html.form(
{"onSubmit": handle_form},
html.input({"name": "firstname"}),
html.p("test"),
html.button({"type": "submit", "value": "Submit"}, "Submit"),
html.input({"lastname": "lastname"}),
html.p("tes2t"),
)
run(Form) Note the Also, I changed Could you address the tests given these changes? In addition to the |
Serializing form attributes into the URL would be a nice feature if we could get it working cleanly. Might help with form value persistence upon WS disconnect? We should do some investigation later down the line to figure out what React apps typically do for forms. |
e8efda1
to
2b070cb
Compare
To properly handle form URLs we'll need a wrapper around the standard form element. Besides that, this PR works. |
What do we plan on doing about file fields |
Not entirely sure. We can address #574 in a different PR though. |
closes: #573