Consider y coord when determining bottom collision (#62403)

This commit is contained in:
Kristina 2023-01-30 09:40:36 -06:00 committed by GitHub
parent 7a465f42a6
commit b6f477ae03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ export const ContextMenu: React.FC<ContextMenuProps> = React.memo(
const OFFSET = 5; const OFFSET = 5;
const collisions = { const collisions = {
right: window.innerWidth < x + rect.width, right: window.innerWidth < x + rect.width,
bottom: window.innerHeight < rect.bottom + rect.height + OFFSET, bottom: window.innerHeight < y + rect.height + OFFSET,
}; };
setPositionStyles({ setPositionStyles({