Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if 1 item only, Not display that item in "updateF7SmartSelect()" #72

Open
exit2000 opened this issue Jan 17, 2024 · 0 comments
Open

if 1 item only, Not display that item in "updateF7SmartSelect()" #72

exit2000 opened this issue Jan 17, 2024 · 0 comments

Comments

@exit2000
Copy link

Thanks for your contributions!

If I create a program as follows, the item will not be displayed in updateF7SmartSelect().

Update smart select

if (interactive()) {
library(shiny)
library(shinyMobile)

shinyApp(
ui = f7Page(
title = "My app",
f7SingleLayout(
navbar = f7Navbar(title = "Update f7SmartSelect"),
f7Button("updateSmartSelect", "Update Smart Select"),
f7SmartSelect(
inputId = "variable",
label = "Choose a variable:",
selected = "drat",
choices = colnames(mtcars)[-1],
openIn = "popup"
)
# tableOutput("data")
)
),
server = function(input, output, session) {
# output$data <- renderTable({
# mtcars[, c("mpg", input$variable), drop = FALSE]
# }, rownames = TRUE)

  observeEvent(input$updateSmartSelect, {
    updateF7SmartSelect(
      inputId = "variable",
      openIn = "sheet",
      selected = "hp",
      # choices = c("hp", "gear"),
      choices = c("hp"),  # If it changes like this
      multiple = TRUE,
      maxLength = 3
    )
  })
}

)
}

Thank you for reading it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant