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

run_with_themer() style depends on browser #954

Open
royfrancis opened this issue Dec 28, 2023 · 1 comment
Open

run_with_themer() style depends on browser #954

royfrancis opened this issue Dec 28, 2023 · 1 comment

Comments

@royfrancis
Copy link

I have tried bslib::run_with_themer() in chrome, firefox and safari.

The bootstrap and shiny themes are examples where they are very similar, but not identical.

bootstrap

shiny

The cosmo theme is an example where they are wildly different.

cosmo

The chrome version is the closest to reality because that's what I see in all browsers if I actually run the app with a theme (bs_theme(preset = "cosmo")).

R version 4.3.0 (2023-04-21)
Platform: aarch64-apple-darwin20.0.0 (64-bit)
Running under: macOS Ventura 13.6.2
bslib_0.6.1.9000
@royfrancis
Copy link
Author

Also, it seems to hijack my submit button. Here is my app:

library(shiny)
library(bslib)
library(bsicons)
library(DT)

# ui
ui=page_fluid(
  card(style="margin-top:1em;",
    card_header(
      h2("bslib test"),
      h4("Testing UI components")
    ),
    layout_sidebar(
      sidebar = sidebar(
        fileInput("file-input","fileInput"),
        selectInput("select-input",label="selectInput",choices=c("A","B","C")),
        numericInput("numeric-input",label="numericInput",value=5,min=1,max=10),
        sliderInput("slider-input",label="sliderInput",value=5,min=1,max=10),
        textInput("text-input",label="textInput"),
        textAreaInput("text-area-input",label="textAreaInput"),
        dateInput("date-input",label="dateInput"),
        dateRangeInput("date-range-input",label="dateRangeInput"),
        radioButtons("radio-button",label="radioButtons",choices=c("A","B","C"),inline=T),
        tooltip(
          checkboxInput("checkbox", "checkboxInput", value = FALSE),
          "This is a tooltip"
        ),
        popover(
          bsicons::bs_icon("info-circle"),
          title = "This is a popover",
          "Popover message goes here"
        ),
        actionButton("action-button","Action"),
        hr(),
        submitButton()
      ),
      DT::datatable(iris)
    ),
    card_footer(
      "2024 Brand"
    )
  )
)

# server
server=function(input,output) {
}

shinyApp(ui=ui,server=server)
library(bslib)
run_with_themer()

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

No branches or pull requests

1 participant