Skip to content

Commit

Permalink
Don't automatically namespace ID in custom extendShinyjs functions; f…
Browse files Browse the repository at this point in the history
…ixes #229
  • Loading branch information
DavidBarke committed Jan 12, 2021
1 parent e7aa98d commit e39b373
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/jsFunc-aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ jsFunc <- function(...) {

# similar to jsFunc, but here we already know the function name and parameters
jsFuncHelper <- function(fxn, params) {
# is fxn a function defined by shinyjs (not by the user with extendShinyjs)
isShinyjsFunction <- fxn %in% shinyjsFunctionNames("all")

# get the Shiny session
session <- getSession()

fxn <- paste0("shinyjs-", fxn)

# respect Shiny modules/namespaces
if (inherits(session , "session_proxy")) {
# respect Shiny modules/namespaces in shinyjs functions
if (inherits(session , "session_proxy") && isShinyjsFunction) {
if ("id" %in% names(params) && !is.null(params[['id']])) {
if (!"asis" %in% names(params) || !params[['asis']]) {
params[['id']] <- session$ns(params[['id']])
Expand Down

0 comments on commit e39b373

Please sign in to comment.