今日已更新 178 条资讯 | 累计 22368 条内容
关于我们

React - How to create a dropdown and other similar components, which escape outside Its parent container?

/u/prois99 2026年05月30日 04:53 3 次阅读 来源:Reddit r/webdev

Hello, How can I implement a component overlay, like a dropdown or popover, so it escapes its parent container instead of being clipped, hidden, or expanding the parent layout? I managed to do it with getBoundingClientRect(), store the position in state and apply it as fixed positinioning. Even though it seems to work, wonder if there is a better solution. Thank you. submitted by /u/prois99 [link] [留言]

本文内容来源于互联网,版权归原作者所有
查看原文