Skip to content

Commit

Permalink
the return value can now be triggered even if the same input value is…
Browse files Browse the repository at this point in the history
… used consecutively (only if using shiny version 1.1)
  • Loading branch information
daattali committed Nov 6, 2018
1 parent e84a300 commit c3d17f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Package: shinyalert
Title: Easily Create Pretty Popup Messages (Modals) in 'Shiny'
Version: 1.0.0.9003
Version: 1.0.0.9004
Authors@R: c(
person("Dean", "Attali", email = "daattali@gmail.com",
role = c("aut", "cre"), comment = "R interface"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -5,6 +5,7 @@
- New feature (#11): `inputId` parameter added, which allows you to set the input ID that is used to retrieve the return value of the modal
- Slight documentation changes
- small change to demo shiny app UI
- the return value can now be triggered even if the same input value is used consecutively (only if using shiny version 1.1)

# shinyalert 1.0

Expand Down
7 changes: 6 additions & 1 deletion inst/www/srcjs/shinyalert.js
Expand Up @@ -22,7 +22,12 @@ Shiny.addCustomMessageHandler('shinyalert.show', function(params) {
}

var callback = function(value) {
Shiny.onInputChange(params['inputId'], value);
if ('compareVersion' in Shiny &&
Shiny.compareVersion(Shiny.version, ">=", "1.1.0") ) {
Shiny.setInputValue(params['inputId'], value, {priority: "event"});
} else {
Shiny.onInputChange(params['inputId'], value);
}
callbackJS(value);
callbackR(value);
delete params['inputId'];
Expand Down

0 comments on commit c3d17f8

Please sign in to comment.