簡體   English   中英

閃亮的selectize在每次選擇后輸入關閉的選擇

[英]Shiny selectizeInput close choices after each selection

我想調整閃亮的selectizeInput小部件以允許選擇多個選擇,但是默認行為是保持選擇列表處於打開狀態,直到單擊其他位置為止(請參閱http://shiny.rstudio.com/gallery/selectize-examples .html 2號)。 在我的應用程序中,用戶必須不時選擇多個選擇,但大多數情況下只能選擇一個。 因此,我希望顯示的選擇列表在每個選擇之后都折疊起來,但是selectizeInput的閃亮參數似乎不允許該功能。

有什么想法可以改變這種標准行為嗎?

selectizeInput(
        inputId = "portfolios",
        label = "Select Portfolio(s):",
        choices = currPortfolios,
        selected = "",
        multiple = TRUE,
        options = list(maxItems = 5)
      )

您可以使用closeAfterSelect = TRUE選項。

selectizeInput(
        inputId = "portfolios",
        label = "Select Portfolio(s):",
        choices = currPortfolios,
        selected = "",
        multiple = TRUE,
        options = list(maxItems = 5, closeAfterSelect = TRUE)
      )

請注意,它不是100%用戶友好的-您必須單擊遠離輸入,然后再單擊回到輸入內部的任何空格以重新打開列表。 沒什么大不了的,僅供參考。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM