glin / reactable

Interactive data tables for R
https://glin.github.io/reactable
Other
627 stars 80 forks source link

filterInputStyle option in reactiveTheme() does not work #186

Closed jnhyeon closed 3 years ago

jnhyeon commented 3 years ago

Hello. Thanks for making such a nice package. I'm enjoying and using the packages you've created.

I found one problem while using it. Among the many options of reactiveTheme(), the filterInputStyle option didn't work.

Below is the example code.

thank you.

--------------- example code ------------- library(shiny) library(dplyr) library(reactable)

data(iris)

dark_theme <- reactableTheme( color = 'white', backgroundColor = 'rgb(52, 58, 64)', borderColor = 'rgb(69, 77, 85)', stripedColor = 'rgb(69, 77, 85)', highlightColor = 'rgb(69, 77, 85)', inputStyle = list(backgroundColor = 'rgb(52, 58, 64)'), filterInputStyle = list(color = 'white', # <- not working backgroundColor = 'rgb(69, 77, 85)'), selectStyle = list(backgroundColor = 'rgb(52, 58, 64)'), pageButtonHoverStyle = list(backgroundColor = 'rgb(69, 77, 85)'), pageButtonActiveStyle = list(backgroundColor = 'rgb(69, 77, 85)') )

ui <- fluidPage( checkboxInput('dark_mode', 'Dark mode', value = FALSE), reactableOutput('table') )

server <- function(input, output, session) { output$table <- renderReactable({ if (input$dark_mode) { iris %>% reactable(filterable = TRUE, theme = dark_theme) } else { iris %>% reactable(filterable = TRUE) } }) }

shinyApp(ui, server)

image

glin commented 3 years ago

Thanks for the report! This was inadvertently fixed in the development version some time ago, but I didn't realize it. I've now added a NEWS item for this:

  • In reactableTheme(), filterInputStyle now applies correctly when rerendering a table in Shiny (#186).
jnhyeon commented 3 years ago

I confirmed that it worked fine after reinstalling from github. Thank you very much :)