Skip to content

Commit 0238fb6

Browse files
committed
fix reset for colourpicker inputs
1 parent c2d84a9 commit 0238fb6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

R/reset.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ reset <- function(id = "", asis = FALSE) {
9292
type <- "Text"
9393
}
9494

95-
# Make sure reset works with namespecing (shiny modules)
95+
# Make sure reset works with namespacing (shiny modules)
9696
id <- x
9797
if (substring(id, 1, nchar(nsName)) == nsName) {
9898
id <- substring(id, nchar(nsName) + 1)
@@ -149,6 +149,8 @@ reset <- function(id = "", asis = FALSE) {
149149
funcParams[['value']] <- value
150150
}
151151

152+
updateFunc <- sprintf("update%sInput", type)
153+
152154
# radio buttons don't follow the regular shiny input naming conventions
153155
if (type == "RadioButtons") {
154156
updateFunc <- sprintf("update%s", type)
@@ -157,9 +159,6 @@ reset <- function(id = "", asis = FALSE) {
157159
else if (type == "Colour") {
158160
updateFunc <- utils::getFromNamespace(updateFunc, "colourpicker")
159161
}
160-
else {
161-
updateFunc <- sprintf("update%sInput", type)
162-
}
163162

164163
# update the input to its original values
165164
do.call(updateFunc, funcParams)

0 commit comments

Comments
 (0)