-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[REF-1368] Move common form functionality to rx.el.forms #2801
Conversation
Allow plain HTML Form element to have magic on_submit event handler.
Consolidate logic in the basic HTML form and use it in both Radix and Chakra form wrappers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the auto-docs don't show the extra props, but I'm leaning in favor of removing some of the base html props to keep our api simple (can do later on)
@overload | ||
@classmethod | ||
def create( # type: ignore | ||
cls, | ||
*children, | ||
as_: Optional[Union[Var[str], str]] = None, | ||
accept: Optional[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to keep all these other props also, do they work? We could delete them in the base el.Form, I think it may add more noise/clutter than benefit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The radix form for sure supports all of the native HTML Form props... chakra, i'm less sure about. At any rate, i don't think these will show up in the API docs, but I'll check before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base form props are not rendering in the API docs. going ahead with the merge.
Hi, the |
…2801) * [REF-1368] Move common form functionality to rx.el.forms Allow plain HTML Form element to have magic on_submit event handler. * Chakra and Radix forms inherit `on_submit` functionality from rx.el.form Consolidate logic in the basic HTML form and use it in both Radix and Chakra form wrappers. * from __future__ import annotations for py38
Allow plain HTML Form element to have magic on_submit event handler.
Chakra and Radix forms inherit on_submit functionality from rx.el.form
Consolidate logic in the basic HTML form and use it in both Radix and Chakra form wrappers.
Update
test_form_submit.py
Run the integration test with all three types of form roots to ensure consistent behavior.