rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
472 stars 57 forks source link

fix(card): Report full screen state at `<id>_full_screen` #1032

Closed gadenbuie closed 6 months ago

gadenbuie commented 6 months ago

This PR updates how cards report their full screen state. Now, given

card(id = "my_card", full_screen = TRUE, ...)

users will need to use input$my_card_full_screen to react to the card's full screen state change.

Previously, we were providing input$my_card with essentially list(full_screen = TRUE), which we chose intending to leave room for future state or event data reporting. However, any use of input$my_card takes a reactive dependency on the entire data structure reported from the client. If we imagine that we've added another reported event type via input$my_card, changes in the new event type will cause input$my_card$full_screen to invalidate, even if the value doesn't change.

I explored a range of other options and using the <id>_full_screen pattern seems to be the most straightforward and best option at this time.