Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature to scroll the viewport to display the menu #632
Our project required the menu of an enabled dropdown to always be in view when the menu is activated. This PR introduces this feature. The viewport will only be shifted if the menu isn't in focus.
We discussed different implementations such as the dropdown menu displaying above the select box. This implementation required the least amount of change to the code.
The implementation also uses a prop to calculate how much space to place below the menu and the viewport base. We discussed whether or not this should be calculated dynamically from css rather then a prop (incorporating any margin-bottom thats applied to .Select-menu) as this is arguably a styling concern but this semantically might not make sense as margins don't apply to elements taken out of document flow.
If you are interested in this feature but would like some changes please let us know!