Skip to content

Commit

Permalink
fixes to verbatim pop up
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolas Burkoff committed Oct 26, 2022
1 parent b87c016 commit e06dfae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/verbatim_popup.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ verbatim_popup_ui <- function(id, button_label, ...) {
shiny::singleton(
shiny::tags$head(shiny::includeScript(system.file("js/verbatim_popup.js", package = "teal.widgets")))
),
shiny::actionButton(ns("button"), label = button_label, ...)
shiny::uiOutput(ns("container"))
)
}

Expand All @@ -56,7 +56,12 @@ verbatim_popup_srv <- function(id, verbatim_content, title, style = FALSE,
checkmate::assert_flag(ignoreInit)
moduleServer(id, function(input, output, session) {
ns <- session$ns
disabled_flag_observer(disabled, "button", ignoreInit)

output$container <- renderUI({
disabled_flag_observer(disabled, "button", ignoreInit)
shiny::actionButton(session$ns("button"), label = "my label")
})

modal_content <- format_content(verbatim_content, style)
button_click_observer(
click_event = shiny::reactive(input$button),
Expand All @@ -65,6 +70,7 @@ verbatim_popup_srv <- function(id, verbatim_content, title, style = FALSE,
modal_title = title,
modal_content = modal_content
)

})
}

Expand Down

0 comments on commit e06dfae

Please sign in to comment.