-
Notifications
You must be signed in to change notification settings - Fork 83
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 component #2023
Comments
Nevermind. My thoughts were stuck in form fields for some reason, and I didn’t realize this was about the whole form itself. |
Probably this will also cover https://github.com/vaadin/vaadin-form-layout/issues/97 or if not, I'd suggest that 🙂 |
@heruan thanks for reminder. That is a slightly different thing, but it could be attempted to done within the same scope (at least, prototyping would make sense). |
A “fieldset / field group” component was in the scope for V13, but it looks like it might be a bit tight and might not make it in time. |
Any news? I love the idea! ❤️ |
One implementation idea (which surfaced in a discussion with @tomivirkki) that might be worth prototyping was that it might be pretty simple to use a native Maybe it would even be possible to implement this kind of feature in each component (a mixin maybe?) so a separate custom form element is not needed (at least for basic form submission). A component could check in Though we would also need to be able to prevent this from happening for components which are used as an implementation detail within another component, so that only the value of the top level component if propagated to the form. |
@Haprog What you describe sounds like a polyfill for the potentially upcoming Form Participation API. |
@Legioth I didn't actually think about that when writing the comment, but even better if this could be more of a standards based polyfill instead of custom behaviour/implementation. Form Participation API (formdata and Form-associated custom elements) is already part of the HTML spec and implementation on they way at least in Chrome. |
There is an open proposal for a Vaadin Form library to help with creating forms with Web Components. Please join the discussion at https://github.com/vaadin/proposal-for-vaadin-form |
Suggestion: implement the
<vaadin-form>
component.Purpose
Cover a very common use case based on lacking support for native Form submission API for Custom Elements, see WICG/webcomponents#187 and also w3ctag/design-reviews#305
Use cases:
1. Get rid of the
<iron-form>
in the codevaadin-login
is depending on it: https://github.com/vaadin/vaadin-login/blob/ed96ee8e014a3217bd8905fbdc3708737667580a/src/vaadin-login.html#L91<iron-form>
pulls in a quite big<iron-ajax>
dependency which we don't use at all2. Get rid of the issues which
<iron-form>
has:3. Get rid of the
<iron-form>
in the demosForm submission and validation examples are currently using
<iron-form>
without even explaining WTF is this and why do we need it:4. Get rid of the
<iron-form>
in the testsUltimate goal would be to drop the support for this external dependency, starting from the next major versions, e.g. in V15 (so that we reduce the vendor lock-in and promote our own stuff)
5. Provide the better UX and DX for
<vaadin-form-layout>
users:vaadin-form-layout
vaadin-form-layout#286. Provide the lightweight component for using with LitElement
Ideally, the
<vaadin-form>
should be vanilla Custom Element, it doesn't need Polymer or LitElement dependency). This way, we can attract LitElement users who will soon feel that they miss something like that.7. Future ideas
Implementation
The first version can be implemented by porting some parts of the
<iron-form>
code (and tests) and removing all the opinionated AJAX related logic.And please, let's not make it commercial component.
The text was updated successfully, but these errors were encountered: