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

STCOM-1282. Multiselection overlay overlapping input under certain conditions. #2269

Merged
merged 4 commits into from
Apr 25, 2024

Conversation

JohnC-80
Copy link
Contributor

@JohnC-80 JohnC-80 commented Apr 16, 2024

The positioning of <MultiSelection/>'s overlay element is completely controlled by the popper library. To affect the placement at the instance level, popper's options include an object with 'modifiers' - a bunch of different adjustments that are applied/accounted for when the overlay element is rendered. One of them is 'preventOverflow' that keeps an element within the bounds of a certain scrollable parent/element. It defaults to the scrollParent of the input the overlay belongs to.

The case sited in STCOM-1282 has <MultiSelection> being used within a *short <EditableList>. The scrollParent - the MCL's scrollable element - with only 3 items is not tall enough to render the overlay without it overlapping the <MultiSelection> control. The renderToOverlay prop is used as it should be on the MultiSelection, but popper still wants to stick to MCL's scrollable element as its boundary.

Approach

This PR changes the setting applied to popper iin <MultiSelection> if the renderToOverlay prop is used, setting the boundaryElement of the preventOverflow modifier to the div#OverlayContainer rendered within the stripes UI.

@JohnC-80 JohnC-80 requested review from a team, zburke and BogdanDenis April 16, 2024 14:56
Copy link

github-actions bot commented Apr 16, 2024

Jest Unit Test Statistics

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit 716bfff. ± Comparison against base commit 9fec08c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 16, 2024

BigTest Unit Test Statistics

       1 files  ±0         1 suites  ±0   13s ⏱️ ±0s
1 443 tests ±0  1 437 ✔️ ±0  6 💤 ±0  0 ±0 
1 445 runs  ±0  1 439 ✔️ ±0  6 💤 ±0  0 ±0 

Results for commit 716bfff. ± Comparison against base commit 9fec08c.

♻️ This comment has been updated with latest results.

Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really appreciate the detail in the PR description. It would have been impossible to tell what was going, or why this is necessary without it. Thank you!

Copy link

sonarcloud bot commented Apr 25, 2024

@JohnC-80 JohnC-80 merged commit ee7cea4 into master Apr 25, 2024
6 checks passed
@JohnC-80 JohnC-80 deleted the STCOM-1282 branch April 25, 2024 18:40
github-actions bot pushed a commit that referenced this pull request Apr 25, 2024
…nditions. (#2269)

* if renderToOverlay is used, set the boundary to the overlay container

* log changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants