[AP-5360] Reset popover position on each close #754
Merged
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.
What
When style, which defines popover position, is not set, popover is rendered at the end of
document.body. After initial render, popover get its trigger and content dimensions and recalculates style to correct one. It causes temporarily visible blinking effect when popover is rendered in lower left part of the screen and then in correct position (see below screencast).20250407-1220-30.1741746.mp4
Similar thing happens when try to open same popover twice. On first opening, it calculates its position and store it in state. But if popover's trigger position changes, we can see blinking again, because popover renders on old position and then re-renders itself to correct position (see screencast).
Screen.Recording.2025-09-16.at.13.42.11.mov
To fix first problem, when style is empty, default style is used that is outside viewport. That way, user can't see first render and sees only popover in correct position.
Similarly, second problem is fixed by resetting style on each close.
Screen.Recording.2025-09-16.at.13.51.20.mov
Testing
Is this change covered by the unit tests?
Is this change covered by the integration tests?
Is this change covered by the automated acceptance tests? (if applicable)
Compatibility
Screenshots
Before
After