Skip to content

Commit

Permalink
fixed selected arg in dragulaInput
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Mar 16, 2022
1 parent 7be7d79 commit 67efd93
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: esquisse
Type: Package
Title: Explore and Visualize Your Data Interactively
Version: 1.1.0.9100
Version: 1.1.0.9200
Authors@R: c(person("Fanny", "Meyer", role = c("aut")),
person("Victor", "Perrier", email = "[email protected]", role = c("aut", "cre")),
person("Ian", "Carroll", comment = "Faceting support", role = "ctb"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
+ spanish, activate with `set_i18n("es")`, thanks to [@drdsdaniel](https://github.com/drdsdaniel)
+ albanian (updated), activate with `set_i18n("al")`, thanks to [@EGjika](https://github.com/EGjika)

### Bug fixes

* Fix `selected` argument of `dragulaInput()` being ignored outside bookmarking.



# esquisse 1.1.0
Expand Down
20 changes: 10 additions & 10 deletions R/input-dragula.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ dragulaInput <- function(inputId,
boxStyle = NULL,
width = NULL,
height = "100px") {
bookmark <- restoreInput(id = inputId, default = selected)

bookmark <- restoreInput(id = inputId, default = NULL)
if (!is.null(bookmark)) {
selected <- bookmark$target
}
Expand All @@ -77,14 +77,14 @@ dragulaInput <- function(inputId,

targets <- generate_targets(
inputId = inputId,
args = args,
args = args,
targetsLabels = targetsLabels,
targetsIds = targetsIds,
targetsIds = targetsIds,
selected = selected,
replace = replace,
boxStyle = boxStyle,
badge = badge,
status = status,
replace = replace,
boxStyle = boxStyle,
badge = badge,
status = status,
height = height
)
targetsIds <- targets$ids
Expand Down Expand Up @@ -160,7 +160,7 @@ generate_targets <- function(inputId, args, targetsLabels, targetsIds, selected,
targetsIds <- targetsLabels
}
stopifnot(length(targetsLabels) == length(targetsIds))

target_ids <- makeId(targetsIds)

replaceTargets <- target_ids
Expand Down Expand Up @@ -237,7 +237,7 @@ make_bg_svg <- function(text) {


#' @title Update Dragula Input
#'
#'
#' @description Update [dragulaInput()] widget server-side.
#'
#' @param session The `session` object passed to function given to `shinyServer`.
Expand Down

0 comments on commit 67efd93

Please sign in to comment.