diff --git a/DESCRIPTION b/DESCRIPTION index af583bb5..55680c89 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: shiny.semantic Title: Semantic UI Support for Shiny -Version: 0.5.0 +Version: 0.5.0.9000 Authors@R: c(person("Filip", "Stachura", email = "filip@appsilon.com", role = "aut"), person("Dominik", "Krzeminski", role = "aut"), person("Krystian", "Igras", role = "aut"), diff --git a/NEWS.md b/NEWS.md index b45cf476..ea82d199 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -# shiny.semantic 0.5.0 +# shiny.semantic (development) + +- Fixed `range_input` now returns both lower and upper bound. + +# [shiny.semantic 0.5.0](https://github.com/Appsilon/shiny.semantic/releases/tag/0.5.0) - `shiny.semantic` no longer uses CDN as the default source of assets. Instead, `semantic.assets` package was introduced. diff --git a/R/shiny.R b/R/shiny.R index d2bf7e7b..9484ba68 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -31,6 +31,14 @@ NULL # Add directory for static resources file <- system.file("www", package = "shiny.semantic", mustWork = TRUE) shiny::addResourcePath("shiny.semantic", file) + shiny::registerInputHandler("shiny.semantic.vector", function(value, ...) { + if (is.null(value)) { + return(value) + } else { + values <- jsonlite::fromJSON(value) + return(values) + } + }, force = TRUE) } #' Create universal Shiny input binding diff --git a/inst/www/shiny-semantic-slider.js b/inst/www/shiny-semantic-slider.js index 4376e42b..1a48b009 100644 --- a/inst/www/shiny-semantic-slider.js +++ b/inst/www/shiny-semantic-slider.js @@ -52,14 +52,14 @@ $.extend(semanticSliderBinding, { if ($(el).data('ticks')) { return $(el).data('ticks')[value]; } else { - return value; + return(JSON.stringify(value)) } }, getType: function(el) { if ($(el).data('ticks')) { return false; } else { - return 'shiny.number'; + return 'shiny.semantic.vector'; } }, // Given the DOM element for the input, set the value.