How to deselect selected input

This program allows fort he selection of many files from a folder. Is there any way to deselect the selected files? For example, I select some file I do not really want to select and I need to undo the selection.


ui <- fluidPage(
                 height: 1000px;
                 width: 800px;
                 background-color: #b0c4de;
                 font-size: 12px; line-height: 12px;
       selectInput('selectfile','Select File', choice = list.files(),multiple = TRUE),      



server <- function(input, output){
  output$fileselected <- renderText({
    paste0('You have selected: ', input$selectfile)


shinyApp(ui = ui, server = server)

Hi, just to check: do you mean giving the user less choices to choose from or letting the user undo the selection? If you mean the later, they can do this by clicking something they've already selected again.

You can try it out yourself here ^^

1 Like


1 Like

Hi sowla,

Yes. it works for single selection, but I cannot get it to work for multiple selections? Is there any thing else I should include in the selectInput statement?


Hi I'm sorry, I'm not entirely sure I understand. Did you try the example(s) in the link? If you haven't, could try this first? :slight_smile:

In my experience, for the "No choose prompt, multiple" Select example, I can select many options and deselect them all one by one. Similarly, in the Selectize example, I can select many options and deselect by clicking the option(s) again and pressing delete. This time though, if I also press Alt or Shift at the same time, I can select multiple options before pressing delete. I use a mac, so the keys might be different if you use something else.

Thank you!. I tried the examples, but I did not use any keys. I will try again.

It does work in my PC selecting the item and pressing Delete. Thank you!

Thanks very much for your info.

This is a repeat of the previous thank you note that I cannot delete.

I am having the same problem. It's a pity that you have to press Delete to remove options. That is not obvious. A click should be enough to do it.

1 Like