Skip to content

Commit

Permalink
tidy up next page buttons and relabel id for error button
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrace committed Dec 11, 2024
1 parent f036133 commit 3862f3b
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions R/run_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ run_example <- function() {
word_limit = 300
),
heading_text("button_Input", size = "s", id = "button_input_text_types"),
button_Input("btn2", "Go to next page"),
button_Input("btn3", "Check for errors", type = "warning")
button_Input("btn_error", "Check for errors", type = "warning")
)
),

Expand All @@ -236,7 +235,6 @@ run_example <- function() {
heading_text("govTabs", size = "s"),
shinyGovstyle::govTabs("tabsID", data, "tabs"),
heading_text("button_Input", size = "s", id = "button_input_tables_tabs_accordions"),
button_Input("btn4", "Go to next page"),
heading_text("accordions", size = "s"),
shinyGovstyle::accordion(
"acc1",
Expand Down Expand Up @@ -406,22 +404,14 @@ run_example <- function() {
shiny::updateTabsetPanel(session, "tab-container", selected = "text_types")
})

shiny::observeEvent(input$btn1, {
shiny::updateTabsetPanel(session, "tab-container", selected = "tables_tabs_and_accordions")
})

shiny::observeEvent(input$btn1, {
shiny::updateTabsetPanel(session, "tab-container", selected = "feedback_types")
})

# Need this to use live update the word counter
shiny::observeEvent(
input$text_area2,
word_count("text_area2", input$text_area2)
)

# Trigger error if text_are2 is blank
shiny::observeEvent(input$btn3, {
shiny::observeEvent(input$btn_error, {
if (input$text_area2 == "") {
error_on("text_area2")
} else {
Expand Down

0 comments on commit 3862f3b

Please sign in to comment.