Render VirtualizedComboBox items under the dropdown selector with option for max height / items
Describe the feature that you would like added
Currently when the VirtualizedComboBox renders more than a certain number of items the actual list of items to select render to the side of the control. Many folks in my team have mention that this is a bug until I realized that this is the currently desired behavior.
What component or utility would this be added to
Option to render the items for a combo box directly under the combo box selector. Option to control how many items are rendered. I.e. right now it just takes up the whole screen. I would like to only render N items or have a max width of N pixels
Have you discussed this feature with our team, and if so, who
Nope
Links / Screenshots
https://codepen.io/willfrasier/pen/bGVZVKJ?editors=0010

The desired behaviour is something more like this:
- Items rendered under select
- item count capped at either number of items or height

@WillFrasier Thanks for reaching out to us! As you said I believe this behaviour is intended by design so we will consider as a feature request and add it to the backlog for review. It might take a while to get to it as we're currently focused on larger work items like performance and coherence (see V8 issue pinned on repo). @joschect is this a behaviour that we might want to consider to implement as a new feature and if so, what should be the priority?
I think issue comes from the fact that callout grows beyond page size.
You can try to workaround this issue using some styles, just limit size of callout and options' container of VirtualizedComboBox, like for example so:
const comboBoxStyles: Partial<IComboBoxStyles> = {
root: {
maxWidth: '300px'
},
callout: {
maxHeight: '300px',
},
optionsContainerWrapper: {
maxHeight: '300px',
},
optionsContainer: {
maxHeight: '300px',
},
};
Thanks @shytikov . This didn't seem to have any effect. Can you please post a link to a live example?

@WillFrasier, the correct property of the VirtualizedComboBox to set a max height and to prevent that repositioning is calloutProps (interface ICalloutProps).
<VirtualizedComboBox
...
useComboBoxAsMenuWidth={true}
calloutProps={{
calloutMaxHeight: 300,
}}
/>
You can check it in an updated codepen.
Setting calloutMaxHeight is a nice workaround (thank you! 🙏 ), but I'd also appreciate a reposition boolean or something similar that would then dynamically set the height of the Callout based on position and available viewport space.
Never mind! directionalHintFixed is the prop I was looking for.
calloutProps={{
directionalHintFixed: true,
}}
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.