How to de-select items in selectInput with multiple = TRUE?

752 views
Skip to first unread message

ying chen

unread,
May 21, 2014, 11:23:18 PM5/21/14
to shiny-...@googlegroups.com
Hi guys,

I have a simple question regarding selectInput with multiple = TRUE. How to de-select items I selected initially?  For example, I selected 3 items from the selectInput box, and later I changed my mind and only wanted 2 items. I tried and did not see a way to de-select an item.

One more question, I tried selectInput("varMisc", "Misc",choiceNames, multiple = TRUE,selected=isolate(input.varMisc)) in ui.R, but shiny complains that input is not an object. What did I do wrong?

Thanks a lot for the help!

Ying

Yihui Xie

unread,
May 21, 2014, 11:29:18 PM5/21/14
to ying chen, shiny-discuss
If you are using shiny 0.9.1, selectInput() uses selectize.js by
default, and you can delete selected options using Backspace or Delete
on your keyboard, just like deleting text.

Regards,
Yihui


On Wed, May 21, 2014 at 10:23 PM, ying chen <njs...@gmail.com> wrote:
> Hi guys,

(and ladies :)
Please refrain from posting the same question twice in different
threads. Thanks!

Huidong TIAN

unread,
May 22, 2014, 8:34:42 AM5/22/14
to shiny-...@googlegroups.com
Click with 'Ctrl' pressed.

Aline Deschamps

unread,
Jun 27, 2017, 7:21:22 AM6/27/17
to Shiny - Web Framework for R
Hi,

Is there a way to supress selected choice by clicking directly on it ?

I thought about using "onclick" but I don't know how to catch the element name of a choice selected.

Thank you in advance !

Best regards.
Reply all
Reply to author
Forward
0 new messages