Skip to content
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

Fix tab input value updating for BS4 dropdowns #3412

Merged
merged 6 commits into from
Jun 2, 2021
Merged

Conversation

cpsievert
Copy link
Collaborator

This fixes an oversight made in #3372, when we switched (back to) emit-ing li a.dropdown-item instead of a.dropdown-item. To verify the fix, notice how (before this change) selecting tab B results in an input value of NULL (when it should be "B"):

library(shiny)

ui <- fluidPage(
  theme = bslib::bs_theme(version = 4),
  tabsetPanel(
    id = "tabs",
    tabPanel("A", "a"),
    navbarMenu("menu", tabPanel("B", "b"))
  )
)

server <- function(input, output, session) {
  observe({
    print(input$tabs)
  })
}

shinyApp(ui, server)

@cpsievert cpsievert requested a review from schloerke June 2, 2021 19:03
srcts/src/main.ts Outdated Show resolved Hide resolved
srcts/src/main.ts Outdated Show resolved Hide resolved
@cpsievert cpsievert merged commit dcca77c into master Jun 2, 2021
@cpsievert cpsievert deleted the bs4-nav-bugfix branch June 2, 2021 20:55
schloerke added a commit that referenced this pull request Jun 2, 2021
* master:
  Fix tab input value updating for BS4 dropdowns (#3412)
  Follow up to #3410: bump version and update news (#3411)
  Bootstrap 5 support (#3410)
  Use bslib's new nav() api to implement tabPanel() and friends (#3388)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants