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

Link popover does not scroll with page #15371

Closed
ellatrix opened this issue May 1, 2019 · 6 comments
Closed

Link popover does not scroll with page #15371

ellatrix opened this issue May 1, 2019 · 6 comments
Labels
[Package] Format library /packages/format-library [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@ellatrix
Copy link
Member

ellatrix commented May 1, 2019

Describe the bug

Introduced by #14938. Cc @aduth.
Noticed while testing #15035.

When the link popover is visible, and you scroll the page, the link popover doesn't move. That's because it have a fixed position. Previously the popover element would be positioned in the RichText wrapper element, and would be positioned relative to that.

Suggested fix: add an option to Popover to allow inline positioning with relative coordinates.

@ellatrix ellatrix added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release [Package] Format library /packages/format-library labels May 1, 2019
@aduth
Copy link
Member

aduth commented May 22, 2019

Suggested fix: add an option to Popover to allow inline positioning with relative coordinates.

A challenge to consider here is that Popover is implementing using portals (i.e. non-relative) in part to avoid dealing with CSS style cascade effects. Reintroducing relative positioning reintroduces this potential conflict.

@ellatrix
Copy link
Member Author

ellatrix commented May 27, 2019

@aduth Previously [the component] also used Popover, but wrapped in an extra relatively positioned div. Not sure how exactly it worked then. :)

@aduth
Copy link
Member

aduth commented May 28, 2019

@aduth Previously also used Popover, but wrapped in an extra relatively positioned div. Not sure how exactly it worked then. :)

Did GitHub eat your markup between words "Previously" and "also" ? Unsure if your comment was meant to include a reference to a specific example.

If I recall correctly, Popover was originally positioned relatively, and then refactored to be separate in the DOM when Slot/Fill was first introduced. Maybe that's the previous implementation relied upon.

Actually, just now looking at the implementation, worth pointing out that Popover does render in-place if there is no Slot context for it to render in to:

// In case there is no slot context in which to render,
// default to an in-place rendering.
if ( getSlot && getSlot( SLOT_NAME ) ) {
content = <Fill name={ SLOT_NAME }>{ content }</Fill>;
}

(Unrelated: cc @jorgefilipecosta you had mentioned some issues with Popover in Widgets screen, I wonder if this might be the cause)

@jorgefilipecosta
Copy link
Member

(Unrelated: cc @jorgefilipecosta you had mentioned some issues with Popover in Widgets screen, I wonder if this might be the cause)

Thank you for bringing this up, I think the popovers problems in the widgets screen were related to not having a working PopoverProvider there.

@ellatrix
Copy link
Member Author

ellatrix commented Jun 17, 2019

Did GitHub eat your markup between words "Previously" and "also" ? Unsure if your comment was meant to include a reference to a specific example.

Sorry, corrected. :) Just meant to refer to the component affected.

What I meant is that, previously the link container also used Popover, but somehow it was placed relatively to the rich text container. I'm not sure how this was done exactly.

@ellatrix
Copy link
Member Author

ellatrix commented Dec 4, 2019

Fixed by #17867.

@ellatrix ellatrix closed this as completed Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Format library /packages/format-library [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

No branches or pull requests

3 participants