Skip to content

Commit b362ccf

Browse files
authored
Merge pull request #5466 from janeewheatley/5465-fix-submit-buttons-when-duplicate-modal-closes
5465 Remove "Saving" State to Allow Submit Buttons to Remain in Original State
2 parents e17358d + 45c82a8 commit b362ccf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/javascript/controllers/audit_duplicates_controller.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ export default class extends Controller {
44
connect() {
55
this.boundHandleSubmit = this.handleSubmit.bind(this)
66
this.element.addEventListener("submit", this.boundHandleSubmit)
7+
8+
// Disable Rails UJS for this form to prevent "Saving" state
9+
this.element.removeAttribute('data-remote')
10+
11+
// Remove data-disable-with from all submit buttons
12+
const buttons = this.element.querySelectorAll('input[type="submit"], button[type="submit"]')
13+
buttons.forEach(button => {
14+
button.removeAttribute('data-disable-with')
15+
})
716
}
817

918
handleSubmit(event) {

0 commit comments

Comments
 (0)