Skip to content

bs_accordion_sidebar is not changing content_main #71

Open

Description

@trafficonese

The content doesn't change when I click on another accordion item. Am I missing something?

library(shiny)
library(htmltools)
library(bsplus)

ui <- fluidPage(
  use_bs_accordion_sidebar(),
  bs_accordion_sidebar(id = "beatles") %>%
    bs_append(
      title_side = "John Lennon", 
      content_side = "Rhythm guitar, vocals",
      content_main = "Dear Prudence"
    ) %>%
    bs_append(
      title_side = "Paul McCartney", 
      content_side = "Bass guitar, vocals",
      content_main = "Blackbird"
    )
)

server <- function(input, output, session) {}

shinyApp(ui, server)

Activity

  1. ijlyttle commented on May 17, 2020

    @ijlyttle
    Owner

    For reasons I did not understand when I wrote it, you have to put use_bs_accordion_sidebar() at the end. I'm sure I can write a fix so that won't be necessary in the future.

    library(shiny)
    library(htmltools)
    library(bsplus)
    
    ui <- fluidPage(
      bs_accordion_sidebar(id = "beatles") %>%
        bs_append(
          title_side = "John Lennon", 
          content_side = "Rhythm guitar, vocals",
          content_main = "Dear Prudence"
        ) %>%
        bs_append(
          title_side = "Paul McCartney", 
          content_side = "Bass guitar, vocals",
          content_main = "Blackbird"
        ),
       use_bs_accordion_sidebar()
    )
    
    server <- function(input, output, session) {}
    
    shinyApp(ui, server)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions