Popover Component: correct changing positions #19992
Merged
Conversation
Contributor
7534cb1 to
1c8f429
Compare
Contributor
Author
|
Thoughts: |
tyxla
approved these changes
Nov 20, 2017
Member
tyxla
left a comment
There was a problem hiding this comment.
This resolves the issue for me 👍 Tested on various locations, seems like it does the job 🎉
Left a small comment, but other than that I think we can go with this quick fix for now 👍
Also, let's make sure tests still pass (seems like they timed out the last time)
Member
There was a problem hiding this comment.
This might be shortened to:
setTimeout( () => this.setPosition(), 0 );
`setPosition` function in the `componentDidUpdate` is called before the popover is finished being drawn. SetTimeout is added to read of positioning after that is complete.
1c8f429 to
e240ee8
Compare
Contributor
Author
|
Thank you @tyxla for reviewing. Addressed. Let's 🚢 |
This was referenced Nov 20, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19666
This patch wraps a function which updates Popover DOM container in
componentDidUpdatelifecycle method in asetTimeoutcallback, so that we read off positioning after it finished rendering.To test:
I believe the issue persists across different sections and settings, mobile or not, so please test on any popover occurrence in Calypso. In particular, we should not see #19666 on the Plans page
https://wordpress.com/plans/:site.Note:
works for other issues where popovers were wrongly positioned
#9007
#13602
#14580
This does not fix the vertical scroll problem, where popovers move into top/bottom margins following their context ( IMO it is a CSS fix and is a separate issue ): #20014