submit _event_ not passed to @submit event #1602
SampsonCrowley
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm actually surprised nobody else has had this issue. it's wild to me that the
@submit
handler for https://formkit.com/inputs/form#submitting doesn't include the actual submit event in any way.the only way to access the real submit event is via
@submit-raw
so accessing the event in the submit handler to do things that are simple in a native form opens the door for race conditions.for instance to detect the clicked button in a form with multiple buttons I could do the following:
and easily have access to the button that clicked submit if the "alternate" was clicked
via Formkit it involves more handling or custom button click handling
from an accessibility standpoint I'd much prefer leaving both submit buttons as
type=submit
and have a way to access the event directly in@submit
instead of only via rawmy proposal would be simply adding it as a 3rd parameter
changing the current signature from
to
Beta Was this translation helpful? Give feedback.
All reactions