-
Notifications
You must be signed in to change notification settings - Fork 265
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]: Unable to use requestSubmit in v2 #9891
Comments
Hi @Nemin32 unfortunately our Form Handling section is outdated, until we've updated it I will hide it from the Storybook for v2. Sorry for the inconvenience. I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository. As a workaround, you can wrap your Hi Colleagues, please check if the I've prepared an StackBlitz example showing the differences between a |
Hello @SAP/ui5-webcomponents-topic-core , please check out this issue about requestSubmit method not being supported for ui5-form. Regards, |
Hi, thank you for the quick reply! @Lukas742 your workaround works great, we're able to proceed. |
Hi @Nemin32, as @Lukas742 said the Everyone is using forms in its own way so we left this to be handled separately with the solution that Lukas provided. We will revise the description of the component to give more clear statement about this. Thanks! Regards, |
The Form web component is a layout, it isn't a replacement for the form HTML element. The Form web component does not provide any APIs for form submission Fixes: #9891
Describe the bug
Hello,
We've been using UI5 v1 in our project and have relied on the UI5 Form component acting as an actual HTML
<form>
component, which may be submitted using therequestSubmit
method called on the form's ref. However, during our migration to v2, we experienced unusual fatal errors which we tracked down torequestSubmit
beingundefined
.From what we could find, the new
ui5-form
element doesn't support submitting with either therequestSubmit
method, aButton
component set totype="Submit"
, or by callingdispatchEvent
. Instead it relies on a call to_internals.form.requestSubmit()
(see here) which also doesn't work, because the_internals.form
elem remainsnull
. This is also a problem, because we rely on React Hook Form, which needs a proper form to work.This is currently blocking us from finishing the upgrade. The migration docs mention the Form element being a drop-in replacement to the v1 variant, so I would kindly ask for your help how to make the new component work with our workflow.
Thank you for your assistance.
Isolated Example
No response
Reproduction steps
Expected Behaviour
The contents of the form are alerted out to the user, due to the
onSubmit
event firing.Screenshots or Videos
No response
UI5 Web Components for React Version
2.1.0
UI5 Web Components Version
2.2.0
Browser
Firefox
Operating System
MacOSX 15
Additional Context
No response
Relevant log output
No response
Organization
SAP
Declaration
The text was updated successfully, but these errors were encountered: