Make submit event code work with both jQuery event and native event (#29223)
Partially related to #29200 and fix other potential bugs. Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
5e1bf3efe2
commit
658cbddbfb
3 changed files with 3 additions and 2 deletions
|
@ -58,7 +58,7 @@ function initRepoDiffConversationForm() {
|
|||
const formData = new FormData($form[0]);
|
||||
|
||||
// if the form is submitted by a button, append the button's name and value to the form data
|
||||
const submitter = submitEventSubmitter(e.originalEvent);
|
||||
const submitter = submitEventSubmitter(e);
|
||||
const isSubmittedByButton = (submitter?.nodeName === 'BUTTON') || (submitter?.nodeName === 'INPUT' && submitter.type === 'submit');
|
||||
if (isSubmittedByButton && submitter.name) {
|
||||
formData.append(submitter.name, submitter.value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue