Hi,
I'm trying to build a module from your f7SmartSelect function and ran into an issue where the namespaces interfere for the select ui and the a call when defining the f7SmartSelect here:
Is there are reason for this assignment? It seems to interfere with use in server-side rendering more than it is an issue in the UI. Please let me know.
For completeness, this is the module I am trying to build out:
smart_select_ui <- function(id, ...) {
ns <- NS(id)
uiOutput(ns("select-ui"), ...)
}
to_reactive<-function(x){
if(!is.reactive(x)) return(reactive(x))
return(x)
}
smart_select_server <-
function(input,
output,
session,
label,
choices,
selected = NULL,
multiple = F,
width = NULL,
openIn = c('page', 'sheet', 'popup', 'popover'),
...) {
session$ns -> ns
label = to_reactive(label)
choices = to_reactive(choices)
selected = if(!is.null(selected)) to_reactive(selected) else reactive({
req(choices())
choices()[1]})
multiple = to_reactive(multiple)
width = to_reactive(width)
openIn = to_reactive(openIn)
output[['select-ui']] <- renderUI({
print(ns("select"))
# shinyMobile::f7SmartSelect(
f7SmartSelect(
inputId = "select",
label = label(),
choices = choices(),
selected = selected(),
multiple = multiple(),
width = width(),
openIn = openIn(),
...
)
})
return(list(selected = reactive(input[['select']])))
}
Testing it out in development, it seems commenting out the referenced line allows you to retain the reactivity on the server side and the ability to continue accessing the input
Hi,
I'm trying to build a module from your f7SmartSelect function and ran into an issue where the namespaces interfere for the select ui and the a call when defining the f7SmartSelect here:
shinyMobile/R/f7-inputs.R
Line 1403 in f458fbc
Is there are reason for this assignment? It seems to interfere with use in server-side rendering more than it is an issue in the UI. Please let me know.
For completeness, this is the module I am trying to build out:
Testing it out in development, it seems commenting out the referenced line allows you to retain the reactivity on the server side and the ability to continue accessing the input