RinteRface / shinybulma

🌐 Bulma.io for Shiny
https://rinterface.github.io/shinybulma/
Other
111 stars 15 forks source link

UI elements in bulmaModal? #40

Closed tylerlittlefield closed 1 year ago

tylerlittlefield commented 1 year ago

Is it possible to put UI elements (e.g. dropdown) in the modals?

library(shiny)
library(shinybulma)

ui <- bulmaPage(
  bulmaActionButton("show_modal", "Show modal")
)

server <- function(input, output){
  observeEvent(input$show_modal, {
    bulmaModal(
      id = "mymodal", 
      list(
        title = "Modal title",
        body = bulmaSelectInput("test", "test", letters)
      )
    )
  })
}

if (interactive()) shinyApp(ui, server)
JohnCoene commented 1 year ago
library(shiny)
library(shinybulma)

ui <- bulmaPage(
  bulmaActionButton("show_modal", "Show modal")
)

server <- function(input, output){
  observeEvent(input$show_modal, {
    bulmaModal(
      id = "mymodal", 
      list(
        title = "Modal title",
        body = as.character(bulmaSelectInput("test", "test", letters))
      )
    )
  })
}

if (interactive()) shinyApp(ui, server)
JohnCoene commented 1 year ago

Pushed a fix, you can reinstall and omit as.character

tylerlittlefield commented 1 year ago

Nice, thanks @JohnCoene !