-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
navbarMenu()
aren't being selected
properly on pageload
#3519
Comments
Just to add: this bug does not occur if the first tab is not within a dropdown menu: ui <- navbarPage(
"my app",
id="tab",
tabPanel("Custom Data", "custom data: please upload"),
navbarMenu("Load", icon=icon("table"),
"----",
tabPanel("Public Data", "public data online")),
navbarMenu("Analyse", icon=icon("cogs"),
tabPanel("quick analysis", "fast!"),
tabPanel("slow analysis", "more time")),
navbarMenu("Visualise", icon=icon("chart-bar"),
tabPanel("plots", "avoid pie charts")))
server <- function(input, output) {
observe(print(input$tab))
}
shinyApp(ui=ui, server=server) |
navbarMenu()
aren't being selected
properly on pageload
Thanks for the report! The fix for this will come via the |
Wow, I was not expecting such a quick reply (with the issue fixed) so soon... Great job, thank you for your work! 😄 |
The fix for this is now on CRAN -- |
# bslib 0.3.1 ## New features * Upgraded Bootstrap 5 (i.e., `bs_theme(version = 5)`) from 5.0.2 to 5.1.0 (#365) ## Bug fixes * Closed rstudio/shiny#3519: `nav_menu()` (i.e., `shiny::navbarMenu()`) wasn't producing an `.active` class on it's `.dropdown` container properly. (#372) # bslib 0.3.0 ## Breaking changes * Closed rstudio/rmarkdown#2154: `{magrittr}`'s pipe operator (`%>%`) is no longer re-exported by `{bslib}`. Either `library(magrittr)` to make `%>%` available and/or use use R 4.1's pipe operator (`|>`). ## New features * Closed #82: Added support for Bootstrap 5 (via `bs_theme(version = 5)`). Bootstrap 4 remains the default in this release, but the next release, the default will likely change to Bootstrap 5. ## Bug fixes * Closed #6: rmarkdown's .tabset-fade class now works with Bootstrap 4+ since legacy use of .nav .fade is now officially supported in Bootstrap 4+. (#325)
* Add snapshot test for #3519 which was fixed via rstudio/bslib#372 * sync package version (GitHub Actions) * yarn build (GitHub Actions) * `yarn build` (GitHub Actions) * Sync package version (GitHub Actions) Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
System details
Browser Version: Safari 15.0
Output of
sessionInfo()
:Example application or steps to reproduce the problem
Describe the problem in detail
The current implementation of tabs with
navbarPage
is giving some bugs as you can see from the reproducible example.When opening the app, click in any tab inside the navigation bar. It opens as expected, but the first tab (Custom Data) is still active (blue). When trying to select the first tab (Custom Data), nothing happens.
This bug is reflected by the ID of the selected tab that doesn't show correctly. When selecting a second tab, it shows the selected tab is
NULL
.After clicking in some tabs, the tabs start working as expected again. I don't understand what is going on, any temporary workaround is appreciated. Thanks!
The text was updated successfully, but these errors were encountered: