iTwin / iTwinUI-react

A react component library for iTwinUI.
https://github.com/iTwin/iTwinUI
Other
83 stars 23 forks source link

fix(ComboBox): Move max-height to outer element to fix virtual scroll #986

Closed mayank99 closed 1 year ago

mayank99 commented 1 year ago

Virtualization broke after #840 because maxHeight: 315 was removed from Surface (presumably because the max-height is specified in the css through iui-menu.iui-scroll). But that doesn't work, because for virtual scroll to work, the max-height must be on the outermost element.

This PR unsets the Menu max-height by removing iui-scroll, and manually adds the same max-height to the outermost element (Surface). Also adds a visual test for it to help catch any future regressions.

Unrelated: elevation={1} was removed from Surface because that's the default in css now.