-
Notifications
You must be signed in to change notification settings - Fork 12
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
[DEV-13410] Fix - Coverage placeholder search input #573
[DEV-13410] Fix - Coverage placeholder search input #573
Conversation
… in a smarter way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
if (container.current) { | ||
const viewport = document.body.getBoundingClientRect(); | ||
const rect = container.current.getBoundingClientRect(); | ||
setMaxHeight(clamp(viewport.height - rect.top - 4, minHeight, maxHeight)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is 4
magic number? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but I think it's probably a bottom padding. I restored this code from how it was before.
I can add a constant for it, but I'm gonna rework these dialogues this week during my project so probably not worth spending extra time on this.
I've noticed some problems in the app with the usage of Popper, so I've brought back the minHeight and maxHeight calculation, so Popper doesn't have to flip the entire dropdown unless the available space is less than minHeight.
This makes the dropdown still usable while opened near the bottom of the screen.
There was also a bug with the position of the dropdown when addon is present - this was due to usage of
bottom
placement which anchors to the center of the element (the search input). I've changed it to anchor tobottom-end
, so it's always aligned.Another thing that has been fixed is the active element is now properly visible when the dropdown is displayed (previously the active item was sometimes hidden, since the dropdown was scrolled down a bit).