Skip to content

Commit a898a6f

Browse files
authored
Fix login modal issue. (#503)
* Fix login modal issues: Turbo 422 status and modal closing * Refactor login failure to proper Turbo response * remove extra code * minor fix * minor fix
1 parent 5359cc2 commit a898a6f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/javascript/controllers/remote_form_controller.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ export default class extends Controller {
4141
form.classList.remove("was-validated");
4242

4343
if (this.autoClose) {
44-
$(that.form)
45-
.closest(".modal")
46-
.modal("hide");
44+
document.dispatchEvent(new CustomEvent("ajax-modal:close"));
4745
} else if(!this.disableHistoryOnSubmit){
4846
history.pushState(
4947
{},

0 commit comments

Comments
 (0)