From 4d417f15c547f349399d131b82e64c83bb679d04 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 4 Jan 2023 12:23:20 +0100 Subject: [PATCH] Fix event registration for modal autofocus --- app/javascript/retrospring/features/questionbox/index.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/javascript/retrospring/features/questionbox/index.ts b/app/javascript/retrospring/features/questionbox/index.ts index a2b7b3e9..7531e7e5 100644 --- a/app/javascript/retrospring/features/questionbox/index.ts +++ b/app/javascript/retrospring/features/questionbox/index.ts @@ -8,10 +8,7 @@ export default (): void => { { type: 'click', target: document.querySelector('#new-question'), handler: questionboxPromoteHandler }, { type: 'click', target: document.querySelectorAll('[name=qb-all-ask]'), handler: questionboxAllHandler }, { type: 'keydown', target: document.querySelectorAll('[name=qb-question]'), handler: questionboxUserInputHandler }, - { type: 'keydown', target: document.querySelectorAll('[name=qb-all-question]'), handler: questionboxAllInputHandler } + { type: 'keydown', target: document.querySelectorAll('[name=qb-all-question]'), handler: questionboxAllInputHandler }, + { type: 'shown.bs.modal', target: document.querySelector('#modal-ask-followers'), handler: questionboxAllModalAutofocus } ]); - - // unfortunately Bootstrap 4 relies on jQuery's event model, so I can't use registerEvents here :( - // TODO: when upgrading to Bootstrap 5 replace this with a normal DOM event - $('#modal-ask-followers').on('shown.bs.modal', questionboxAllModalAutofocus); }