everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React
https://www.react-laag.com
MIT License
906 stars 44 forks source link

Autofocus causing scroll #31

Closed zeitvertrieb closed 2 years ago

zeitvertrieb commented 4 years ago

Hello, great component. one question: I tested a menu accessible (as described here: https://dev.to/everweij/accessible-and-adaptive-select-menu-s-using-react-laag-and-downshift-abn) But since the Menu is rendered in DOM not in root and right before body end the autofocus causes a automatic scroll to the end of my view (although the menu is in the header). I hope I did describe this clearly. any ideas. thanks. (-- I believe it actually is a downshift topic. so probably the wrong spot here.)

everweij commented 4 years ago

Thanks @zeitvertrieb for reporting this issue! I will need to do some investigation first. Do you have something like a codesandbox you can share, so I can reproduce the issue?

zeitvertrieb commented 4 years ago

Hi @everweij, I use the experimental feature: container on the ToggleLayer. seems to work fine – if the parent container is not set to relative or absolute position.