Skip to content

Commit

Permalink
Merge pull request #454 from svalvaro/develop
Browse files Browse the repository at this point in the history
fix: updated function that was used in an example
  • Loading branch information
jakubnowicki committed Mar 22, 2024
2 parents 0d923f9 + 8ddabd2 commit 3bbabdb
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 44 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Expand Up @@ -58,4 +58,4 @@ VignetteBuilder:
Encoding: UTF-8
Language: en-US
LazyData: TRUE
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
36 changes: 15 additions & 21 deletions R/dropdown.R
Expand Up @@ -153,32 +153,26 @@ selectInput <- function(inputId, label, choices, selected = NULL, multiple = FAL
#'
#' @examples
#' if (interactive()) {
#' library(shiny)
#' library(shiny.semantic)
#'
#' library(shiny)
#' library(shiny.semantic)
#'
#' ui <- function() {
#' shinyUI(
#' semanticPage(
#' title = "Dropdown example",
#' dropdown_input("simple_dropdown", LETTERS[1:5], value = "A", type = "selection multiple"),
#' p("Selected letter:"),
#' textOutput("selected_letter"),
#' shiny.semantic::actionButton("simple_button", "Update input to D")
#' )
#' ui <- semanticPage(
#' title = "Dropdown example",
#' dropdown_input("simple_dropdown", LETTERS[1:5], value = "A", type = "selection multiple"),
#' p("Selected letter:"),
#' textOutput("selected_letter"),
#' shiny.semantic::actionButton("simple_button", "Update input to D")
#' )
#' }
#'
#' server <- shinyServer(function(input, output, session) {
#' output$selected_letter <- renderText(paste(input[["simple_dropdown"]], collapse = ", "))
#'
#' observeEvent(input$simple_button, {
#' update_dropdown(session, "simple_dropdown", value = "D")
#' })
#' })
#' server <- function(input, output, session) {
#' output$selected_letter <- renderText(paste(input[["simple_dropdown"]], collapse = ", "))
#'
#' shinyApp(ui = ui(), server = server)
#' observeEvent(input$simple_button, {
#' update_dropdown_input(session, "simple_dropdown", value = "D")
#' })
#' }
#'
#' shinyApp(ui, server)
#' }
#'
#' @export
Expand Down
34 changes: 34 additions & 0 deletions man/shiny.semantic.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 16 additions & 22 deletions man/update_dropdown_input.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3bbabdb

Please sign in to comment.