BitButton
should trigger form onsubmit when inside a form
#2866
linkdotnet
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
If wished I can try to create a Pull-Request. The described solution above would be a breaking change. As you released |
Beta Was this translation helpful? Give feedback.
0 replies
-
thanks for pointing out the issue. I agree with your solution, it's feasible and I think it works fine. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not sure if this is really feasible and I do understand that the idea is arguable at best. But anyway:
Any button, which doesn't define explicitly the
type="button"
inside a form, will be oftype="submit"
.Specification can be found here: https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-type
That means if we have a component like this:
Clicking on the button would invoke
HandleSubmit
. Only explicitly setting it toButtonType="BitButtonType.Submit"
.Now I do understand that the default is
ButtonType.Button
which translates totype="button"
. The confusion comes from the point that if you would do that in html (without specifing the type) the form would be submitted.One possible solution would be to make
ButtonType
optional aka nullable and check whether or not aEditContext
is available.Beta Was this translation helpful? Give feedback.
All reactions