feat: Add automatic dropdown positioning#1014
Conversation
|
Hi there! 👋 Thank you for your contribution to the FIP Guide! 🚀 Checklist before merging:
|
✅ Deploy Preview for fipguide ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @MoritzWeber0 thank you for your implemenation :) |
It should only appear if the scrollbar is necessary because the content overflows, which does happen on browser viewport with < 520px height. There are workarounds to hide scrollbars, but usually not really recommended as it also overwrites the system preferences regarding scrollbars. The default on Windows is to show the scrollbar, while on Android or macOS this isn't the case. |

Use the new anchor and position-try systems in CSS, available since January in all major browsers to automatically position the dropdown menu.
For horizontal positioning, automatically shift the dropdown menu to the left if there is not enough space on the screen. For vertical positioning, use scrolling to handle the overflow.
Resolves #1013