Uh oh!
There was an error while loading. Please reload this page.
Dropdown start hidden - #1171
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/primer/primer-components/21K3SRZu2efPDqwVo8GsXGNxDaGa |
| return () => { | ||
| // ensure the refs get updated on unmount | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| setRefs(combinedRef.current) | ||
| } |
There was a problem hiding this comment.
This ensures that the callback refs get called with null if their container component is removed. Without this, useAnchoredPosition wouldn't know that the floating element disappeared, and thus not set the position to undefined ever after the first time a menu is opened.
Uh oh!
There was an error while loading. Please reload this page.
6c4f8fe to
9a44800Compare
The
Overlaycurrently shows immediately when theDropdownMenu/ActionMenuopens, and then it is positioned. This change will keep them in avisibility: hiddenstate until after the position is calculated and applied. This prevents the element from popping into place visibly, and ensure the animations run properly. Also unblocks #1165, which needs the changes made inuseAnchoredPosition.Merge checklist