Skip to content

Commit

Permalink
fix label issue in FilterStateChoices (#272)
Browse files Browse the repository at this point in the history
Fixes #271
  • Loading branch information
donyunardi authored May 9, 2023
1 parent 5d5d649 commit 7465005
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/FilterStateChoices.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,13 @@ ChoicesFilterState <- R6::R6Class( # nolint
)

x_factor <- if (!is.factor(x)) {
factor(as.character(x), levels = as.character(sort(unique(x))))
structure(
factor(as.character(x), levels = as.character(sort(unique(x)))),
label = attr(x, "label")
)
} else {
x
}
x_factor <- droplevels(x_factor)

args <- list(
x = x_factor,
Expand Down

0 comments on commit 7465005

Please sign in to comment.