# NOT RUN {
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"
)
})
}
)
}
# }
Run the code above in your browser using DataLab