-
Notifications
You must be signed in to change notification settings - Fork 76
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
Regression with calcite-button#form
where form is not submitted/reset
#5164
Comments
calcite-button#form
where form is not submittedcalcite-button#form
where form is not submitted/reset
Agreed. We can revisit our form-associated pattern to accommodate this. In the meantime, can you use the form-descendant approach as a workaround? For prioritization, can you share more info about your use case and the impact of this? |
One use-case where I came up against this issue was when I tried to treat the contents of a modal like a form, and the modal's buttons like form buttons: <calcite-modal>
<form id="form-id" onsubmit="…" slot="content">
<calcite-input />
</form>
<calcite-button form="form-id" slot="primary" type="submit" />
<calcite-button form="form-id" slot="secondary" type="reset" />
</calcite-modal> This lets me consolidate the submission logic and retain native submission behavior:
Currently achieving this behavior would require separate handlers and added logic: <calcite-modal>
<form slot="content">
<calcite-input onkeyup="…" />
</form>
<calcite-button onclick="…" slot="primary" type="submit" />
<calcite-button onclick="…" slot="secondary" type="reset" />
</calcite-modal> You might run into this problem with other components that separate actions from content, but is perhaps more easily mitigated by just wrapping the whole thing inside a |
This issue will be prioritized after the 1.0 release next month. |
calcite-button#form
where form is not submitted/resetcalcite-button#form
where form is not submitted/reset
Our team (Real-Time & Big Data: ArcGIS Velocity) is running into the same problem. We could use the workaround suggested by @nwhittaker, but this would be a large LOE and could cause some regression as there are a lot of moving parts. It is currently blocking a lot of our tests and verification |
Assigned for researching next steps with the form utility. |
**Related Issue:** #5164 ## Summary This allows developers to associate form components by providing the form ID. ### Notes * the form must be available in the DOM before the component is attached to the DOM * components will not look up ancestors for form if the ID is invalid or if the form is not found
Verified on |
Actual Behavior
Given a submit or reset button associated with a non-ancestor form, clicking the button does not submit/reset the form.
Expected Behavior
Given a submit or reset button associated with a non-ancestor form, clicking the button does submit/reset the form.
Reproduction Sample
https://codepen.io/nwhittaker-esri/pen/wvmQjMO
Reproduction Steps
"onsubmit"
is not printed.Reproduction Version
beta.91
Relevant Info
Possibly introduced by #3287.
I'd also ask to revisit the decision to deprecate the
form
attribute. Marking it as deprecated suggests it'll be removed from the API at some point in the future. I understand it's no longer needed in the case where the buttons are descendants of the<form>
, but if they're not, the attribute is still needed and perfectly valid.Regression?
next.290
The text was updated successfully, but these errors were encountered: