最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - Headless UI V2 Dropdowns Using Built-in Portal Not Showing When Requesting Fullscreen From Specific Element - Stack Overf

programmeradmin4浏览0评论

When I set element.requestFullscreen() on a specific element that doesn't contain the portal root element as its child, the dropdown doesn't appear. However, when normally entering fullscreen mode or using requestFullscreen() on an element that has the portal root as a child, the dropdown shows with normal behavior.

I don't know how to set a portal container by passing a container element as props without entirely building my own floating dropdown using floating-ui. I tried to use useEffect that triggers on every re-render, but it doesn't trigger unless the parent component or state has been updated.

I'm not sure how to capture the portal root element when a dropdown opening event occurs. Should I implement my own floating dropdown with floating-ui? That seems a bit boilerplate-heavy. Maybe I could make this into a custom hook for use in specific scenarios.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论