1

作为一个最小的例子

# Basic usage
library("shiny")
library(shinyWidgets)

ui <- fluidPage(
  pickerInput(
    inputId = "somevalue",
    label = "A label",
    choices = c("apple", "orange", "mango", "pear"),
    options = list(
    `actions-box` = TRUE,
    `live-search` = TRUE,
    `selected-text-format`= "count",
    `count-selected-text` = "{0} choosen (on a total of {1})"),
    multiple = T
  ),
  verbatimTextOutput("value")
)

server <- function(input, output) {
  output$value <- renderPrint(input$somevalue)
}

shinyApp(ui, server)

有没有办法将值复制并粘贴到搜索栏中pickerInput并返回匹配的结果?

例如,如果我从文本文件中复制下面的两行并尝试将它们粘贴到搜索栏中,则不会返回任何内容。

apple
mango

gif

此外,如果单词与列表中可用的单词不匹配,是否可以打印?

编辑 1:我已经按照 Roman 的建议检查了这个问题,但这并不能回答我在这种情况下的问题。该问题使用selectizeInput但我需要保留pickerInput它的功能。

4

0 回答 0