如何使用 @Reach/Dialog创建弹出对话框

发布于 2025-01-21 08:43:38 字数 568 浏览 2 评论 0原文

我想使用到达ui 喜欢 reakit非模式对话框。造型dialogoverlaydialogContent似乎还不够代码>在dialogContent(或dialoGoverlay)不起作用,因为对话框使用body中的门户渲染,因此其位置与整个页面而不是其容器元素。 PR 901 似乎可以解决这个问题。在不裁定图书馆的情况下,是否有任何解决方法可以达到结果?

I want to create a popover dialog using Reach UI like Reakit Non-modal Dialogs. Styling DialogOverlay and DialogContent seems to be not enough because the dialog is rendered inside a Portal in body: Setting position: absolute on DialogContent (or DialogOverlay) does not work because the dialog is rendered using a Portal in the body, so its position is relative to the entire page and not to its container element. The PR 901 seems to address the issue. Is there any workaround to reach the result without forking the library?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文