From b3cbfc762b2e5f8ac24a30f8df90e9cf2b6f0cd5 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 2 Mar 2024 21:38:47 +0100 Subject: [PATCH] Initialize Bootstrap dropdowns on the toggle data attribute --- app/javascript/retrospring/initializers/bootstrap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/retrospring/initializers/bootstrap.ts b/app/javascript/retrospring/initializers/bootstrap.ts index 277f8c15..82e7dab9 100644 --- a/app/javascript/retrospring/initializers/bootstrap.ts +++ b/app/javascript/retrospring/initializers/bootstrap.ts @@ -11,7 +11,7 @@ export default function (): void { const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]'); [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)); - const dropdownElementList = document.querySelectorAll('.dropdown-toggle'); + const dropdownElementList = document.querySelectorAll('[data-bs-toggle="dropdown"]'); [...dropdownElementList].map(dropdownToggleEl => new bootstrap.Dropdown(dropdownToggleEl)); // HACK/BUG?: Bootstrap disables dropdowns in navbars, here we re-enable and "kinda" fix it