Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any intention of making Overlay/PopOver usable without Whisper? #3062

Closed
SevenOutman opened this issue Feb 9, 2023 Discussed in #3061 · 0 comments · Fixed by #3066
Closed

Is there any intention of making Overlay/PopOver usable without Whisper? #3062

SevenOutman opened this issue Feb 9, 2023 Discussed in #3061 · 0 comments · Fixed by #3066

Comments

@SevenOutman
Copy link
Member

Discussed in https://github.com/orgs/rsuite/discussions/3061

Originally posted by radix February 8, 2023
When I want to render a popover, but I have a regular old prop that I want to use to control whether the popover is visible, I have to jump through hoops to make Whisper work: use trigger="none", create a ref for the Whisper, and then have a useEffect depending on my prop to call ref.open() or ref.close().

My first thought was to just use Popover by itself, which is close, but it doesn't give me any placement options, so I browsed the code some more and found out that the placement is handled by a component called Overlay, which Whisper wraps around the speaker (via OverlayTrigger).

Unfortunately, not only is Overlay undocumented, I couldn't quite figure out how to use it even with browsing the source; there's some context called OverlayContext that it seems to depend on and which applications can't import. I almost got this working by just calling usePortal with a context of undefined, but that doesn't seem to be the same behavior that I got with Whisper.

I would hope that I should just be able to write something like <Overlay open={myProp}><Popover>...</Popover></Overlay>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant