I was wondering if it is possible to make a popup dialog interactive using brilliant (and shinyBS).
For example, I have a line, and I want to change it, and before I make a dialog box, a question will appear whether I really want to change it. In case I say yes, he does it differently, it discards the change. Here is my attempt, but I found two questions: 1. If you click βyesβ or βnoβ, nothing will change 2. you always need to close the βcloseβ window.
rm(list = ls()) library(shiny) library(shinyBS) name <- "myname" ui =fluidPage( textOutput("curName"), br(), textInput("newName", "Name of variable:", name), br(), actionButton("BUTnew", "Change"), bsModal("modalnew", "Change name", "BUTnew", size = "small", textOutput("textnew"), actionButton("BUTyes", "Yes"), actionButton("BUTno", "No") ) ) server = function(input, output, session) { output$curName <- renderText({paste0("Current name: ", name)}) observeEvent(input$BUTnew, { output$textnew <- renderText({paste0("Do you want to change the name?")}) }) observeEvent(input$BUTyes, { name <- input$newName }) } runApp(list(ui = ui, server = server))
Other suggestions are more than welcome!
source share