From 49a972bfd3f53d4ae35c5876fb994b1d89c334dc Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 4 Jan 2023 13:36:24 +0100 Subject: [PATCH] Remove jQuery call to close question modal --- app/javascript/retrospring/features/questionbox/all.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/retrospring/features/questionbox/all.ts b/app/javascript/retrospring/features/questionbox/all.ts index 96cbc9e2..a7d6a3b8 100644 --- a/app/javascript/retrospring/features/questionbox/all.ts +++ b/app/javascript/retrospring/features/questionbox/all.ts @@ -1,4 +1,5 @@ import { post } from '@rails/request.js'; +import { Modal } from 'bootstrap'; import { showErrorNotification, showNotification } from 'utilities/notifications'; import I18n from 'retrospring/i18n'; @@ -21,7 +22,8 @@ export function questionboxAllHandler(event: Event): void { if (data.success) { document.querySelector('textarea[name=qb-all-question]').value = ''; - window['$']('#modal-ask-followers').modal('hide'); + const modal = Modal.getInstance(document.querySelector('#modal-ask-followers')); + modal.hide(); // FIXME: also solve this using a Stimulus controller const characterCount = document.querySelector('#modal-ask-followers [data-character-count-max-value]').dataset.characterCountMaxValue;