Skip to content
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

Submit form using click handler #776

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Submit form using click handler #776

merged 1 commit into from
Oct 8, 2024

Conversation

lucaswerkmeister
Copy link
Member

Putting the event handler on the button seems more intuitive to me, and works around T376622 (a Codex button doesn’t submit the form when activated using the keyboard). Note that a “click” handler on a button also fires when it’s activated using the keyboard (this is standard browser behavior but still works on a Codex button).

As far as I’m aware, there was no special reason to have the event handler on the form before – the event handler was added in e35cdf3, replacing a different attribute on the <form>, so it probably just seemed natural to put the event handler on the <form> at the time.

Bug: T370052
Bug: T376622

Putting the event handler on the button seems more intuitive to me, and
works around T376622 (a Codex button doesn’t submit the form when
activated using the keyboard). Note that a “click” handler on a button
also fires when it’s activated using the keyboard (this is standard
browser behavior but still works on a Codex button).

As far as I’m aware, there was no special reason to have the event
handler on the form before – the event handler was added in e35cdf3,
replacing a different attribute on the <form>, so it probably just
seemed natural to put the event handler on the <form> at the time.

Bug: T370052
Bug: T376622
Copy link
Contributor

@codders codders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thanks!

@lucaswerkmeister lucaswerkmeister merged commit 503af16 into main Oct 8, 2024
2 checks passed
@lucaswerkmeister lucaswerkmeister deleted the submit branch October 8, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants