Fixed an javascript issue

This commit is contained in:
Jan Böhmer 2023-02-12 17:56:59 +01:00
parent 400cc44838
commit bfc3abd259

View file

@ -33,7 +33,10 @@ class RegisterEventHelper {
registerModalDropRemovalOnFormSubmit() {
//Remove all modal backdrops, before rendering the new page.
document.addEventListener('turbo:before-render', event => {
document.querySelector('.modal-backdrop').remove();
const back_drop = document.querySelector('.modal-backdrop');
if (back_drop) {
back_drop.remove();
}
});
}