From 2f80e74d8ac7055b29fc369928bd5539bcbaeef7 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 23 Jul 2024 12:01:25 +0100 Subject: [PATCH] Set `dropup` on file tree context menu when needed (#19521) GitOrigin-RevId: 7817b95c1896fe6ed3fcb37045821fb31b7b4b1f --- .../file-tree/components/file-tree-context-menu.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx index effb7a0f8d..3afa3ece7b 100644 --- a/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx +++ b/services/web/frontend/js/features/file-tree/components/file-tree-context-menu.tsx @@ -31,9 +31,15 @@ function FileTreeContextMenu() { open id="dropdown-file-tree-context-menu" onToggle={handleToggle} + dropup={ + document.body.offsetHeight / contextMenuCoords.top < 2 && + document.body.offsetHeight - contextMenuCoords.top < 250 + } + className="context-menu" + style={contextMenuCoords} > - + ,