You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently experimenting with a login form implemented using rc-field-form at its core that interacts with an OAuth2/OIDC implementation that expects a traditional server side rendered app for the login form. For this reason, I want to not attach an onFinish() callback to the form, but instead submit it via the native <form> submit mechanism, by setting the action property on the form, like so:
Since FormProps transitively extends React.FormHTMLAttributes I was expecting this to work, but of course it doesn't because here the event propagation of the submit click is stopped in favour of delegating processing to the form instance. I think rc-field-form's behaviour would be less surprising if event propagation were only stopped if:
Form validation fails
An on finish callback is actually attached to the form.
Of course, the alternative would be to omit action (and probably method) from FormProps, though that hardly seems satisfactory to me.
I'm currently experimenting with a login form implemented using rc-field-form at its core that interacts with an OAuth2/OIDC implementation that expects a traditional server side rendered app for the login form. For this reason, I want to not attach an
onFinish()
callback to the form, but instead submit it via the native<form>
submit mechanism, by setting theaction
property on the form, like so:Since
FormProps
transitively extendsReact.FormHTMLAttributes
I was expecting this to work, but of course it doesn't because here the event propagation of the submit click is stopped in favour of delegating processing to the form instance. I think rc-field-form's behaviour would be less surprising if event propagation were only stopped if:Of course, the alternative would be to omit
action
(and probablymethod
) fromFormProps
, though that hardly seems satisfactory to me.A demonstrator reproducing the bug can be found here: https://github.com/ngrewe/rc-field-form-bug
Thanks,
Niels
The text was updated successfully, but these errors were encountered: