Repository navigation
fix(selector-dropdown): add dynamic positioning to the dropdown overlay - #3262
Merged
Merged
Conversation
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
February 24, 2023 02:06
286394b to
81416cd
Compare
ivanthai
commented
Feb 24, 2023
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
February 24, 2023 02:24
6ea35eb to
e3e6702
Compare
ivanthai
force-pushed
the
popper-selector-dropdown
branch
3 times, most recently
from
February 28, 2023 02:27
a0e62b6 to
c541977
Compare
ivanthai
marked this pull request as ready for review
February 28, 2023 02:55
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
February 28, 2023 02:59
c541977 to
b64ada0
Compare
ivanthai
force-pushed
the
popper-selector-dropdown
branch
4 times, most recently
from
March 1, 2023 02:17
acaf55d to
6c15b85
Compare
greathmaster
previously approved these changes
Mar 1, 2023
tjuanitas
reviewed
Mar 1, 2023
ivanthai
force-pushed
the
popper-selector-dropdown
branch
3 times, most recently
from
March 1, 2023 23:55
11fd45a to
977c5a1
Compare
ivanthai
commented
Mar 1, 2023
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
March 2, 2023 18:23
1b33ee4 to
a21966c
Compare
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
March 8, 2023 01:47
24d8fa6 to
11e0847
Compare
tjuanitas
reviewed
Mar 8, 2023
Machoper
previously approved these changes
Mar 15, 2023
tjuanitas
reviewed
Mar 16, 2023
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
March 16, 2023 19:07
c4520e2 to
a45140b
Compare
tjuanitas
previously approved these changes
Mar 20, 2023
tjuanitas
left a comment
Contributor
There was a problem hiding this comment.
left a question but looks good to me!
JChan106
reviewed
Mar 20, 2023
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
March 21, 2023 00:44
8e47ab7 to
e2be200
Compare
Contributor
|
fyi I think some of the changes got reverted back in the last push |
ivanthai
force-pushed
the
popper-selector-dropdown
branch
from
March 21, 2023 18:33
7e92839 to
2ce809f
Compare
tjuanitas
approved these changes
Mar 21, 2023
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.
Updates
isPopperEnabledprop to preserve the former SelectorDropdown behaviorforwardRefto SearchForm because it is used as a child to PopperComponent to SelectorDropdownOverview
SelectorDropdown is not responsive in terms of the dropdown positioning. i.e. when the dropdown doesn't have enough space between the triggering element and the bottom viewport, it doesn't render above the triggering element instead. This change was needed because there is at least one element that doesn't render well in small viewports
Solution
Utilize react-popper to handle the rendering of the overlay. This required adding forwardRefs to the respective children components.
forwardRefandflowdon't get along together well so a fewTo allow backward compatibility with other components that do not want to use react-popper which would change the overlay to use use absolute positioning,
isPopperEnabledwas added. This way, components like TemplateDropdown can remain compatible with SelectorDropdown. TemplateDropdown embeds a PopperComponent within a Flyout which would essentially be embedding an absolute within an absolute without a defined height.An alternative to adding the
isPopperEnabledprop is to have TemplateDropdown override the behavior using CSS which was a bit simplier, but more hackyDemo
Issue - dropdown renders below the viewport

Fix - dropdown renders above the triggering element when there is no space

Smallest supported viewport
