In #45, it's brought up that updateF7Select does not allow for choices to be changed. After playing around with this, I've determined that there's a simple enough fix for this - changing the class of the tags$select() within the f7Select function.
Before:
f7Select = function (inputId,
label,
choices,
selected = NULL,
width = NULL)
{
options <- createSelectOptions(choices, selected)
shiny::tags$div(
class = "list",
style = if (!is.null(width))
paste0("width:", htmltools::validateCssUnit(width),
";"),
shiny::tags$ul(
shiny::tags$li(
class = "item-content item-input",
shiny::tags$div(
class = "item-inner",
shiny::tags$div(class = "item-title item-label",
label),
shiny::tags$div(
class = "item-input-wrap input-dropdown-wrap",
shiny::tags$select(
class = "input-select",
id = inputId,
placeholer = "Please choose...",
options
)
)
)
)
)
)
}
All that is necessary is to modify the class = "input-select" to class = "form-control":
function (inputId,
label,
choices,
selected = NULL,
width = NULL)
{
options <- createSelectOptions(choices, selected)
shiny::tags$div(
class = "list",
style = if (!is.null(width))
paste0("width:", htmltools::validateCssUnit(width),
";"),
shiny::tags$ul(
shiny::tags$li(
class = "item-content item-input",
shiny::tags$div(
class = "item-inner",
shiny::tags$div(class = "item-title item-label",
label),
shiny::tags$div(
class = "item-input-wrap input-dropdown-wrap",
shiny::tags$select(
class = "form-control",
id = inputId,
placeholer = "Please choose...",
options
)
)
)
)
)
)
}
From there, you can use shiny's normal updateSelectInput function instead of updateF7Select and it works as expected. Here is a minimal example:
In #45, it's brought up that
updateF7Select
does not allow for choices to be changed. After playing around with this, I've determined that there's a simple enough fix for this - changing the class of thetags$select()
within thef7Select
function.Before:
All that is necessary is to modify the
class = "input-select"
toclass = "form-control"
:From there, you can use shiny's normal
updateSelectInput
function instead ofupdateF7Select
and it works as expected. Here is a minimal example: