Skip to content

Commit

Permalink
Merge pull request rails#48290 from marckohlbrugge/patch-1
Browse files Browse the repository at this point in the history
Support nested elements inside <button>
  • Loading branch information
jonathanhefner authored Nov 20, 2023
2 parents e1a0f6f + a1504f4 commit 0ad26f7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions activestorage/app/assets/javascripts/activestorage.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions activestorage/app/assets/javascripts/activestorage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions activestorage/app/javascript/activestorage/ujs.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export function start() {
}

function didClick(event) {
const { target } = event
if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
submitButtonsByForm.set(target.form, target)
const submitButton = event.target.closest(":is(button, input)[type='submit']")
if (submitButton && submitButton.form) {
submitButtonsByForm.set(submitButton.form, submitButton)
}
}

Expand Down

0 comments on commit 0ad26f7

Please sign in to comment.