Reputation: 10431
I got a long list that I want to put in a selectInput
in Shiny, but the box for it just takes too much space because it shows all of the selected elements, instead of having a fixed size.
long_list = c("Sed","ut","perspiciatis,","unde","omnis","iste","natus","error","sit","voluptatem","accusantium","doloremque","laudantium,","totam","rem","aperiam","eaque","ipsa,","quae","ab","illo","inventore","veritatis","et","quasi","architecto","beatae","vitae","dicta","sunt,","explicabo.","Nemo","enim","ipsam","voluptatem,","quia","voluptas","sit,","aspernatur","aut","odit","aut","fugit,","sed","quia","consequuntur","magni","dolores","eos,","qui","ratione","voluptatem","sequi","nesciunt,","neque","porro","quisquam","est,","qui","dolorem","ipsum,","quia","dolor","sit","amet","consectetur","adipisci","velit,","sed","quia","non","numquam","eius","modi","tempora","incidunt,","ut","labore","et","dolore","magnam","aliquam","quaerat","voluptatem.","Ut","enim","ad","minima","veniam,","quis","nostrum","exercitationem","ullam","corporis","suscipit","laboriosam,","nisi","ut","aliquid","ex","ea","commodi","consequatur?","Quis","autem","vel","eum","iure","reprehenderit,","qui","in","ea","voluptate","velit","esse,","quam","nihil","molestiae","consequatur,","vel","illum,","qui","dolorem","eum","fugiat,","quo","voluptas","nulla","pariatur")
shinyUI(pageWithSidebar(
div(),
sidebarPanel(
selectInput(inputId="mylist",label="Long list",choices=long_list,selected=long_list,multiple=T)
),
mainPanel(
h1("foo")
)
))
How can I change the layout so that it does not take so much space but instead takes a fixed maximum height?
Upvotes: 2
Views: 1794
Reputation: 10431
The only solution right now is to use selectize=FALSE
. This does not allow for browser searching within the list, but the size of the window can be determined.
Upvotes: 2