-
Notifications
You must be signed in to change notification settings - Fork 198
Fix popover repositioning #528
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
Conversation
Signed-off-by: HichamELBSI <elabbassih@gmail.com>
|
This pull request is being automatically deployed with Vercel (learn more). design-system – ./🔍 Inspect: https://vercel.com/strapijs/design-system/5cGSP7kykBdeqsTSiQnVUCZxogc1 design-system-website – ./website🔍 Inspect: https://vercel.com/strapijs/design-system-website/TCLxrP7436S9LzQAeaJrAGevNNaw |
| ); | ||
|
|
||
| useResizeObserver(source, () => | ||
| useResizeObserver([source, popoverRef], () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Add the popover as a source to observe in order to trigger the setPosition on every changes on this element.
| useEffect(() => { | ||
| const resizeObs = new ResizeObserver(onResize); | ||
| resizeObs.observe(source.current); | ||
| if (Array.isArray(sources)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Be able to observe multiple sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's so nice, thank you!
ronronscelestes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAY well done 🔥🙏
gu-stav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So cool ✨
Fix popover repositioning. Useful for the Combobox component.