Merge pull request #1193 from keepassxreboot/fix/ignore_formaction_submit_elements

Ignore buttons with different formaction
This commit is contained in:
Sami Vänttinen 2021-01-31 09:42:14 +02:00 committed by GitHub
commit 4992b20519
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -189,8 +189,8 @@ kpxcForm.getFormSubmitButton = function(form) {
}
// Try to find another button. Select the last one.
// TODO: Possibly change this behavior to select the last one for only certain sites.
const buttons = Array.from(form.querySelectorAll(kpxcForm.formButtonQuery));
// If any formaction overriding the default action is set, ignore those buttons.
const buttons = Array.from(form.querySelectorAll(kpxcForm.formButtonQuery)).filter(b => !b.getAttribute('formAction'));
if (buttons.length > 0) {
return buttons[buttons.length - 1];
}