0

According to the technical documentation here, the switchinput I'm using should default to TRUE at start. I'm just copying in the code from example. In the example code below, it defaults to FALSE.

Any obvious reason why or does it seem buggy?

library(shiny)
library(bslib)
library(shinyWidgets)

ui <- fluidPage(

    navbarPage(
        theme = bs_theme(bootswatch = "flatly", version = 4),
        title = 'Methods',
        tabPanel('One'),
    ),
    mainPanel(
        h1('Hello World'),      
        
    switchInput(
       inputId = "Id012",
       value = TRUE
    ),
        
    )
)

server <- function(input, output) {
    
}

shinyApp(ui, server)
dhc
  • 625
  • 1
  • 6
  • 14
  • 3
    Your code works for me (unless I misunderstand). It defaults to TRUE and responds correctly when changing the default to F (https://postimg.cc/JtMkGJSs). Maybe trying updating your packages and restarting your session afterwards? – BHudson Mar 25 '22 at 13:33
  • @BHudson and porkchop. You are correct. It was seemingly an R version. I was using R 4.1.0 and in that it defaults to FALSE even using the code above. After updating to R 4.1.3, all is well in the world. – dhc Mar 25 '22 at 14:33

0 Answers0