Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
haacked committed Aug 7, 2024
1 parent faf4c56 commit 0e609f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion dist/aspnet-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,13 @@ var ValidationService = /** @class */ (function () {
// Because the submitter is not propagated when calling
// form.submit(), we recreate it here.
var submitter = submitEvent.submitter;
var submitterInput = null;
var initialFormAction = form.action;
if (submitter) {
var name_1 = submitter.getAttribute('name');
// If name is null, a submit button is not submitted.
if (name_1) {
var submitterInput = document.createElement('input');
submitterInput = document.createElement('input');
submitterInput.type = 'hidden';
submitterInput.name = name_1;
submitterInput.value = submitter.getAttribute('value');
Expand All @@ -619,6 +620,10 @@ var ValidationService = /** @class */ (function () {
form.submit();
}
finally {
if (submitterInput) {
// Important to clean up the submit input we created.
form.removeChild(submitterInput);
}
form.action = initialFormAction;
}
}
Expand Down
Loading

0 comments on commit 0e609f9

Please sign in to comment.