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

Navigation block 'missing link' tooltip positioned far away from it's source in site editor #36634

Closed
talldan opened this issue Nov 19, 2021 · 2 comments · Fixed by #36876
Closed
Assignees
Labels
[Block] Navigation Affects the Navigation Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@talldan
Copy link
Contributor

talldan commented Nov 19, 2021

Description

It's easiest to show the screenshot rather than describe this:
Screenshot 2021-11-19 at 11 03 42 am

The 'This item is missing a link' text is far away from the 'Add Link' item it should be connected to.

In testing, I could only reproduce this in the site editor.

Step-by-step reproduction instructions

  1. Add a nav block in the site editor
  2. Start empty
  3. Click the plus button
  4. Hover over the 'Add Link' text.

Screenshots, screen recording, code snippet

No response

Environment info

Mac OS, Brave, Gutenberg trunk.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@talldan talldan added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Nov 19, 2021
@adamziel
Copy link
Contributor

This seems like an issue with the Popover component. Site editor is in an iframe, post editor isn't. .popover-slot where the tooltips are rendered is outside of the iframe. It seems like computePopoverYAxisPosition or some other function in proximity doesn't account account for the iframe's top value.

@adamziel
Copy link
Contributor

adamziel commented Nov 25, 2021

iframes are only considered in when Popover receives either anchorRef or getAnchorRect, but in case of the tooltip neither of these is present. The position is based only on on anchorRefFallback. I think a sensible solution would be to still consider that an iframe may be among the parents in that case.

function computeAnchorRect(
anchorRefFallback,
anchorRect,
getAnchorRect,
anchorRef = false,
shouldAnchorIncludePadding,
container
) {

I proposed a solution in #36876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants