Skip to content
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

feat: form property on form components #29343

Open
3 tasks done
oliveryasuna opened this issue Apr 15, 2024 · 3 comments
Open
3 tasks done

feat: form property on form components #29343

oliveryasuna opened this issue Apr 15, 2024 · 3 comments
Assignees
Labels
needs: reply the issue needs a response from the user

Comments

@oliveryasuna
Copy link

oliveryasuna commented Apr 15, 2024

Prerequisites

Describe the Feature Request

It seems that some of the form components support a form property. For example, ion-button, supports either string (standard, by ID) or HTMLFormElement, which is super useful.

I would love to see this property on other form components, such as ion-input and ion-checkbox.

Describe the Use Case

Associate form elements with a form, as per usual HTML forms.

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

@brandyscarney
Copy link
Member

Thanks for the issue! Could you please provide a use case for this?

@brandyscarney brandyscarney added the needs: reply the issue needs a response from the user label Apr 25, 2024
@ionitron-bot ionitron-bot bot removed the triage label Apr 25, 2024
@oliveryasuna
Copy link
Author

Thanks for the issue! Could you please provide a use case for this?

The form attribute exists so developers can associate inputs not children of a form element.
It is standard HTML.

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels May 3, 2024
@sean-perkins
Copy link
Contributor

@oliveryasuna the team is hoping to understand what limitations or challenges you have with the existing implementation to evaluate if the suggested feature would solve that problem.

Ionic's components are not a 1:1 API with built-in HTML elements. Adding support for a form element to a web component using shadow dom would not associate the form control to the form and would result in no added benefit to developers. Form association for shadow dom is handled by ElementInternals which Ionic Framework is not able to support until v9 at the earliest, due to the supported browser versions (Safari v16.4). Ionic Framework supports the feature of form on ion-button to query and submit the closest form, which is a bit different that form control behavior with associating validity state and values.

If you can provide more information about what you are trying to accomplish, we can best evaluate how to offer workarounds or understand if it is resolved by what ElementInternals will offer.

Thanks!

@sean-perkins sean-perkins added the needs: reply the issue needs a response from the user label May 7, 2024
@ionitron-bot ionitron-bot bot removed the triage label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: reply the issue needs a response from the user
Projects
None yet
Development

No branches or pull requests

3 participants