Skip to content

Commit

Permalink
feat: Adapted example app to new logic of using "_content" to observe…
Browse files Browse the repository at this point in the history
… the inputs.
  • Loading branch information
svalvaro committed Nov 13, 2024
1 parent b7873d6 commit 333879f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions inst/examples/shiny/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ui <- shinyUI(fluidPage(
div(
div(
"This is your new text editor",
quillOutput("editor_1")
quillOutput("editor")
),
div(
hr(),
Expand All @@ -15,23 +15,23 @@ ui <- shinyUI(fluidPage(
))

server <- function(input, output) {
output$editor_1 <- renderQuill({
output$editor <- renderQuill({
quill(
toolbar = toolbar_options(
header = list(c(1, 2, "normal_selected", 3, 4)),
size = c("large", "normal_selected")
)
)
})
observeEvent(input$editor_1, {
observeEvent(input$editor_content, {
cat(
sep = "\n",
get_editor_content(input$editor_1, format = "JSON"),
get_editor_content(input$editor_1, format = "HTML"),
get_editor_content(input$editor_1, format = "Text")
get_editor_content(input$editor_content, format = "JSON"),
get_editor_content(input$editor_content, format = "HTML"),
get_editor_content(input$editor_content, format = "Text")
)
})
output$rendered_output <- renderUI(HTML(get_editor_content(input$editor_1, format = "HTML")))
output$rendered_output <- renderUI(HTML(get_editor_content(input$editor_content, format = "HTML")))
}

shinyApp(ui = ui, server = server)

0 comments on commit 333879f

Please sign in to comment.