-
-
Notifications
You must be signed in to change notification settings - Fork 465
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
fix: elementOverflow
code
#1104
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
container = defaultGetContainer(element); | ||
} | ||
if (!container) { | ||
return "none"; |
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.
can this happen or should it be an error?
) { | ||
let container = getContainer?.(); | ||
if (!container) { | ||
container = defaultGetContainer(element); |
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.
why not just say getContainer = defaultGetContainer
in the function signature?
!container.classList.contains("bn-suggestion-menu") && | ||
!container.classList.contains("bn-grid-suggestion-menu") | ||
) { | ||
return; |
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.
let's make explicit with return undefined (instead of empty return statement)
const defaultGetContainer = (element: HTMLElement) => { | ||
let container: HTMLElement = element; | ||
|
||
while ( |
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 think you can just use https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
No description provided.