ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
29 stars 9 forks source link

Limit combobox and select dropdown to 10.5 visible options #2189

Closed m-akinc closed 5 days ago

m-akinc commented 2 weeks ago

Pull Request

๐Ÿคจ Rationale

Fixes #1870

๐Ÿ‘ฉโ€๐Ÿ’ป Implementation

In setPositioning, where maxHeight of the listbox was already being calculated, now limit to maximum of 10.5 visible items. For a filterable select, the height of the filter adds to the height of the listbox, i.e. we still show 10.5 options. If a select contains grouped options, extra space is not reserved for group headers, meaning fewer than 10.5 options may be visible. This results in a simpler implementation and prevents height changes/jiggle when typing in the filter box and more than 10 options are matched.

๐Ÿงช Testing

Added visual tests for the height limiting behavior, including with/without filter input and above/below.

โœ… Checklist

m-akinc commented 2 weeks ago

@atmgrifter00 mind buddying this?

m-akinc commented 5 days ago

@NIbokeefe sorry, I reset your vote without thinking. No action needed on your part.