Skip to content

Commit

Permalink
Merge pull request #18 from mauromiguelm/bug-shinyalert
Browse files Browse the repository at this point in the history
Temporarily fix conflicts with shinyalert/shinyvalidate
  • Loading branch information
mauromiguelm authored Mar 21, 2024
2 parents 0402dc0 + db51b07 commit 758c28a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inst/app/app-dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ui <- fluidPage(
theme = bslib::bs_theme(version = 5L),
# add button
actionButton("show_wizard", "Show wizard"),
actionButton("show_shinyalert", "Show shinyalert"),
wizard(
modal = TRUE,
lock_start = TRUE,
Expand Down Expand Up @@ -106,6 +107,14 @@ server <- function(input, output, session) {
print("reset wizard")
wizardR::reset("my_modal")
})

observeEvent(input$show_shinyalert, {
shinyalert::shinyalert(
title = "Hello",
text = "This is a shinyalert",
type = "success"
)
})
}

shinyApp(ui, server)
9 changes: 9 additions & 0 deletions inst/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ $.extend(wizard, {

let args = $(el).data("configuration");

// check if wizard is initialized, return if yes
//TODO debug why shinyalert is causing the wizard to re-initialize
if ($(el).data("wizard")) {
return;
}


const wizard = new Wizard(args);

wizard.init();


// expose wizard.lock function
this.lock = function() {
wizard.lock();
Expand Down Expand Up @@ -58,6 +66,7 @@ $.extend(wizard, {
} else if (msg === "reset") {
this.reset();
}
//TODO understand why message show is not being received
// else if (msg.type === "show") {
// var modal = bootstrap.Modal.getOrCreateInstance(
// document.getElementById('wizard-modal-' + el.id), {}
Expand Down

0 comments on commit 758c28a

Please sign in to comment.