Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes sure the Select menu is always visible and usable, regardless where on a page or view the Select is located.
So far, a Select placed at the bottom of a page or view opened its menu downwards, outside of the viewport, while it should open upwards in order the be fully visible and usable.
Background:
Our Select internally uses Headless UI Select with Headless UI Float middleware to handle positioning of the menu.
Headless UI Float has two different placement strategies,
flip()
andautoPlacement()
.Flip()
, which we have used so far, should do smart auto-detection and place an element such as a menu in the desired direction, until it runs out of available space. For some reason we could not figure out in a timely manner, this does not always seem to work as expected. (https://floating-ui.com/docs/flip)autoPlacement()
however simply shows an element in the direction where the most net available space is, and appears to be working fine and robustly in all situations we have tried. (https://floating-ui.com/docs/autoplacement)At a later point we may inspect the issue with usiing
flip()
further, but in order to have a robust solution now we have switched toautoPlacement()
.Changes Made
autoPlacement()
Related Issues
closes #67