Allow to customize initial Popover placement - #2000
Merged
Merged
Conversation
acelaya
commented
Jun 13, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2000 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 70 70
Lines 1314 1319 +5
Branches 484 489 +5
=========================================
+ Hits 1314 1319 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
acelaya
force-pushed
the
popover-placement
branch
6 times, most recently
from
June 17, 2025 08:03
86091b7 to
d2bff47
Compare
acelaya
force-pushed
the
popover-placement
branch
from
June 17, 2025 08:22
d2bff47 to
2f4c499
Compare
acelaya
commented
Jun 17, 2025
| headless: true, | ||
| screenshotFailures: false, | ||
| instances: [{ browser: 'chromium' }], | ||
| viewport: { width: 1024, height: 768 }, |
Contributor
Author
There was a problem hiding this comment.
Tests were a bit flaky without this, due to the default vitest resolution.
This is the viewport we have set in the rest of the projects, but it was overlooked here because it was the first project migrated to vitest.
acelaya
commented
Jun 17, 2025
| // grows further than the opposite side of the anchor element | ||
| { | ||
| children: 'very long text'.repeat(4), | ||
| children: 'very long text'.repeat(8), |
Contributor
Author
There was a problem hiding this comment.
Adjustment needed for the new viewport size used in tests. The viewport is now wider so the text needs to be longer.
acelaya
marked this pull request as ready for review
June 17, 2025 08:43
This was referenced Jun 18, 2025
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.
Add a new
placement?: 'above' | 'below'property to thePopover, so that it is possible to customize the default placement of the popover relative to the anchor.Up until now, popovers would always render below the anchor when there's enough space.
The component can still decide to render in the opposite placement if selected one does not allow for it to render inside the viewport.
popover-placement-2025-06-17_10.01.03.mp4
Test steps
placementproperty doc, which has an example ofaboveandbelowpopovers.Warning
Ideally, when the popover does not fit neither above or below, it should re-position and overlap the anchor element, to make sure it is kept in the viewport.
That is not part of this PR, and will be addressed as part of #1921
TODO