-
Notifications
You must be signed in to change notification settings - Fork 154
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
Not able to click whole button in quarto #683
Comments
I have the same problem. It seems quarto doc is overlaying its own theme upon the radio buttons. Hopefully there is a way to set the css or scss to overlay the default quarto setting. |
PS: you also need |
Tagging @cderv here - do you think this should be posted as an issue in Quarto? Or perhaps do you have a solution to use a different version of Bootstrap (if that is indeed the source of the issue)? Here's a more complete reproducible example of the issue: ---
title: "Test"
format: html
server: shiny
---
```{r}
shinyWidgets::radioGroupButtons(
inputId = "test_radio",
label = NULL,
choices = LETTERS[1:3]
)
shinyWidgets::checkboxGroupButtons(
inputId = "test_checkbox",
label = NULL,
choices = LETTERS[1:3]
)
h1('Radio button selected:')
textOutput("radio")
h1('Checkbox selected:')
textOutput("checkbox")
```
```{r}
#| context: server
output$radio <- renderText(input$test_radio)
output$checkbox <- renderText(input$test_checkbox)
``` Also note that the widgets render and behave as expected as an equivalent non-Quarto shiny app: library(shiny)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
shinyWidgets::radioGroupButtons(
inputId = "test_radio",
label = NULL,
choices = LETTERS[1:3]
),
shinyWidgets::checkboxGroupButtons(
inputId = "test_checkbox",
label = NULL,
choices = LETTERS[1:3]
)
),
mainPanel(
h1('Radio button selected:'),
textOutput("radio"),
h1('Checkbox selected:'),
textOutput("checkbox")
)
)
)
server <- function(input, output) {
output$radio <- renderText(input$test_radio)
output$checkbox <- renderText(input$test_checkbox)
}
shinyApp(ui = ui, server = server) |
I can confirm that Quarto is using Bootstrap 5 - so
Is I don't know how shiny theming works for a quarto shiny document 🤔 So I don't know where the adjustment lies. I know bslib components required some adjustment for everything to be included in Quarto documents. So not sure it is directly linked to Quarto here. It could be involved to pass or set some information but as a reminder Quarto does not use R package bslib for the theming - it uses same adapted Bootstrap version but not the R package and all that it does. Happy to help if I can when I understand how it should work. |
It actually looks like someone accounted for the different Bootstrap versions here. There are |
FWIW looking at shinyWidgets code base, I can see that it uses outdated: see other answer belowIf I set this option for the document ```{r}
options(bootstrapTheme = "bs_version_5")
``` then shinyWidgets will correctly load the bs5 component and not the bs3 as default. And it seems to work I don't know how it should happen and how bslib nor shiny do a make its theme component decision, but I guess shinyWidget could probably default to bs5 inside quarto content (instead of bs3) |
Quarto is using Bootstrap 5, but it does not build on bootstrap directly but on the version of boostrap from bslib |
This comment was marked as outdated.
This comment was marked as outdated.
You can use Full example: quarto doc:
custom.scss file:
|
Okay using |
@jhelvy sorry I mixed up. Regarding the theming, some SCSS variable may need to be defined to get the same exact default theme as in shiny or markdown. I believe the blue you see here comes from the primary color, as tweaked by @pvictor to get it purple. This is controlled by the Quarto theme option: https://quarto.org/docs/output-formats/html-themes.html Default used is bootswatch default theme. |
When I use
radioGroupButtons()
orcheckboxGroupButtons()
in quarto, the buttons do not display as expected.I am using
shinyWidgets 0.8.3
andquarto 1.4.552
.Please let me know if this issue should go in the quarto repo instead.
test.qmd
The text was updated successfully, but these errors were encountered: