[BUGFIX] fix panel links menu positioning#157
Conversation
|
@ayanarukasar can you please follow the PR template checks and include some screenshots or tests when relevant. |
|
@jgbernalp Thanks for the review! I've updated the PR description to follow the template and added a screenshot showing the panel links menu opening next to the link icon. |
| > | ||
| <OnHover> | ||
| {descriptionAction} {linksAction} | ||
| {descriptionAction} {links && links.length > 0 && <LinksDisplay links={links} variant="panel" />} |
There was a problem hiding this comment.
Could be shortened no?
links?.length > 0
There was a problem hiding this comment.
@shahrokni Good catch — updated all three occurrences to use links?.length > 0. Also rebased onto latest main. Thanks!
| > | ||
| <OnHover> | ||
| {descriptionAction} {linksAction} | ||
| {descriptionAction} {links && links.length > 0 && <LinksDisplay links={links} variant="panel" />} |
There was a problem hiding this comment.
414fb20 to
899818b
Compare
|
@ayanarukasar Is the image depicting the previous behavior? It seems the dropdown is not next to the link button |
|
@jgbernalp You're right — the previous screenshot didn't show the fix correctly.
Squashed into a single commit ( |
5d1d8c0 to
8f808f2
Compare
8f808f2 to
bce52ec
Compare
Panel link dropdowns appeared at arbitrary screen positions inside react-grid-layout panels that use CSS transforms. Render a fresh LinksDisplay instance per header breakpoint via renderPanelLinks() and use Popper with strategy: fixed so the menu stays anchored below the link icon. Fixes perses/perses#3654 Signed-off-by: Ayana-Rukasar <ayanark1515@gmail.com>
bce52ec to
2ca6f7d
Compare
|
I wonder if disabling portaling altogether would make the code simpler, as right now we are almost duplicating the same code with or without portal. Does this issue also applies for other context menus like actions or editing, for example when the menu is collapsed in a panel that has no name? |
|
@jgbernalp Good questions! On portaling: I tried On other menus: |
Description
Fixes panel link dropdown menus appearing at arbitrary screen positions instead of next to the link icon.
The menu was portaled to
document.body, which breaks positioning insidereact-grid-layoutpanels that use CSS transforms. This change disables the portal for panel link menus and anchors the menu below the link icon.Fixes perses/perses#3654
Screenshots
After
Checklist
UI Changes