MultiChoice with Scrollbar

Hello everyone,

I am new to Bokeh and what I am trying to do is create a MultiChoice widget with numerous options (> 100). I put it at the top of the page; however, when a user adds a lot of choices and it resizes its height, making all other elements on the page go further down.

So my question is if there is a way to have a fixed (or maximum) height MultiChoice widget with a vertical scrollbar to go up and down to all selections.

Thank you in advance!

PS. I found this link from another post, but it doesn’t seem to work anymore.

Bokeh’s MultiChoice is just a thin wrapper around the third-party choices.js library, and as far as I know, it does not support scrolling the input area. You might need to consider MultiSelect instead, which has a height property that you can set.

Hello @Bryan, and thanks for your quick response.

Yes, I know it doesn’t support scrollbars, but I wanted to know if there was a workaround for that. It doesn’t provide a good user experience when someone adds a lot of options and all elements move down because of the resizing.

Regarding MultiSelect, MultiChoice is superior to it as:

  • The user doesn’t have to press Control in order to select multiple items together like in MultiSelect.
  • Gives the option to search by typing.
  • Makes it easier to select/deselect elements.

Thus, it isn’t an alternative for me.


Hi @zoump I understood your question. There is no workaround that I am aware of, or I would have suggested one.[1] I was only attempting to provide additional context about why. Your further options would be to create your own custom extension that wraps a different widget that suits your needs, or consider a different tool altogether

  1. The old thread you found with the missing link was unrelated and not relevant here. That discussion was concerning scrolling in a column containing multiple widgets, not about scrolling within a single widget. ↩︎

Many thanks for your reply, @Bryan. I guess no other solution works better for me atm.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.