如何使用 @Reach/Dialog创建弹出对话框
我想使用到达ui 喜欢 reakit非模式对话框。造型dialogoverlay
和dialogContent
似乎还不够代码>在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论