R/f7-update-inputs.R
updateF7AutoComplete.Rd
Change the value of an autocomplete input on the client
updateF7AutoComplete( inputId, value = NULL, session = shiny::getDefaultReactiveDomain() )
inputId | The id of the input object. |
---|---|
value | Picker new value. |
session | The Shiny session object, usually the default value will suffice. |
You cannot update choices yet.
if (interactive()) { library(shiny) library(shinyMobile) shinyApp( ui = f7Page( title = "My app", f7SingleLayout( navbar = f7Navbar(title = "Update autocomplete"), f7Card( f7Button(inputId = "update", label = "Update autocomplete"), f7AutoComplete( inputId = "myautocomplete", placeholder = "Some text here!", openIn = "dropdown", label = "Type a fruit name", choices = c('Apple', 'Apricot', 'Avocado', 'Banana', 'Melon', 'Orange', 'Peach', 'Pear', 'Pineapple') ), verbatimTextOutput("autocompleteval") ) ) ), server = function(input, output, session) { observe({ print(input$myautocomplete) }) output$autocompleteval <- renderText(input$myautocomplete) observeEvent(input$update, { updateF7AutoComplete( inputId = "myautocomplete", value = "Banana" ) }) } ) }