Skip to content

Commit

Permalink
Merge branch 'bug-shinyalert' into bug-shinyvalidate
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromiguelm committed Mar 21, 2024
2 parents e830d4d + db51b07 commit fe6c2b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions inst/app/app-dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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
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 fe6c2b1

Please sign in to comment.