Repository navigation
fix: Grid suggestion menu width overflows viewport (BLO-1361) #3096
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
base: main
Are you sure you want to change the base?
Changes from all commits
208ab52
f896978
a816479
4a7615c
4ae1e56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,12 +4,23 @@ export function elementOverflow(element: HTMLElement, container: HTMLElement) { | |
|
|
||
| const topOverflow = elementRect.top < parentRect.top; | ||
| const bottomOverflow = elementRect.bottom > parentRect.bottom; | ||
| const leftOverflow = elementRect.left < parentRect.left; | ||
| const rightOverflow = elementRect.right > parentRect.right; | ||
|
|
||
| const horizontalOverflow = | ||
| leftOverflow && rightOverflow | ||
| ? "both" | ||
| : leftOverflow | ||
| ? "left" | ||
| : rightOverflow | ||
| ? "right" | ||
| : "none"; | ||
|
|
||
| return topOverflow && bottomOverflow | ||
| ? "both" | ||
| : topOverflow | ||
| ? "top" | ||
| : bottomOverflow | ||
| ? "bottom" | ||
| : "none"; | ||
| : horizontalOverflow; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this returns "both" two different cases, so consumers can't distinguish between them. Afaik we only check for "none", so it's better to change this function to a boolean Or, go one step further and see if we can just call https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded or https://github.com/scroll-into-view/scroll-into-view-if-needed, but not sure if any of these are a 1:1 fit and actually better, so needs some research |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.