From 745bee27bf8ca5eba475312210c789d9bd96b4e3 Mon Sep 17 00:00:00 2001 From: Carson Date: Wed, 5 May 2021 09:13:49 -0500 Subject: [PATCH] add nav-item/nav-link to BS4+ dropdowns --- R/bootstrap.R | 13 ++++++++++++- tests/testthat/_snaps/tabPanel.md | 16 ++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/R/bootstrap.R b/R/bootstrap.R index 2ebc8536e4..1783bc000c 100644 --- a/R/bootstrap.R +++ b/R/bootstrap.R @@ -1085,7 +1085,18 @@ buildDropdown <- function(divTag, tabset) { divTag$title, tags$b(class = "caret") ), - navList + navList, + .renderHook = function(x) { + if (isTRUE(getCurrentThemeVersion() >= 4)) { + tagQuery(x)$ + addClass("nav-item")$ + find(".dropdown-toggle")$ + addClass("nav-link")$ + allTags() + } else { + x + } + } ) list( diff --git a/tests/testthat/_snaps/tabPanel.md b/tests/testthat/_snaps/tabPanel.md index e83e0d4391..3f676a5595 100644 --- a/tests/testthat/_snaps/tabPanel.md +++ b/tests/testthat/_snaps/tabPanel.md @@ -86,8 +86,8 @@ B - - - -