闪亮的文本输入填充了列表并且能够预测

问题描述 投票:0回答:1

我需要向 Shiny 应用程序添加一个 textInput,该应用程序的工作与 this 文本框 的工作类似。它需要填充一长串位置/坐标,并能够根据用户输入的内容预测位置的名称。理想情况下,它也会显示滚动条。

See the example

selectInput(inputId = 'locations_coords,label = 'Coordinates',choices = c("John Doe","Ash","Ajay    sharma","Ken Chong","Will Smith","Neo"),selected = NULL,multiple = F)

r shiny textinput
1个回答
0
投票

您可以使用

selectizeInput
并激活其“创建”选项:

library(shiny)

ui <- fluidPage(
  selectizeInput(inputId = "test", 
                 label = "Test",
                 choices = month.name,
                 options = list(create = TRUE,
                                createOnBlur = TRUE)
                 
  )  
)

server <- function(input, output, session) {}

shinyApp(ui, server)
© www.soinside.com 2019 - 2024. All rights reserved.