From 2e8c2a6a49f185f04f5808d5f8484c4185e2ca60 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 19 Jun 2025 23:57:11 +0200 Subject: [PATCH 1/3] New version dropdown: Only scroll context menu content --- .../Assets/web-components/VersionDropdown.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx b/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx index c4d77844a..a12efd815 100644 --- a/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx +++ b/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx @@ -249,16 +249,14 @@ const VersionDropdown = ({ cursor: default; } } + .euiContextMenuPanel > div:not(.euiContextMenuPanel__title) { + max-height: 70vh; + ${useEuiOverflowScroll("y")} + } .euiContextMenuPanel__title { - position: sticky; - top: 0; - // !important because clicking on the title - // makes the background transparent - // and you unexpectedly see the items behind it. background-color: ${euiTheme.colors .backgroundBasePlain} !important; } - ${useEuiOverflowScroll('y')} `} /> From 66237d1fe822c123e30eda8480996b2d3275fa42 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 20 Jun 2025 00:04:49 +0200 Subject: [PATCH 2/3] Change max height of dropdown --- .../Assets/web-components/VersionDropdown.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx b/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx index a12efd815..7647c170b 100644 --- a/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx +++ b/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx @@ -250,7 +250,10 @@ const VersionDropdown = ({ } } .euiContextMenuPanel > div:not(.euiContextMenuPanel__title) { - max-height: 70vh; + // I'm using this height so that the last element + // is cut in half to make it clear to the user that + // there is more content. + max-height: 28.3rem; ${useEuiOverflowScroll("y")} } .euiContextMenuPanel__title { From 2c825e59dd8a784c3c5b7c476998b7a036f5e4a3 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 20 Jun 2025 00:06:35 +0200 Subject: [PATCH 3/3] Prettier --- .../Assets/web-components/VersionDropdown.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx b/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx index 7647c170b..382c79617 100644 --- a/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx +++ b/src/Elastic.Documentation.Site/Assets/web-components/VersionDropdown.tsx @@ -249,12 +249,13 @@ const VersionDropdown = ({ cursor: default; } } - .euiContextMenuPanel > div:not(.euiContextMenuPanel__title) { + .euiContextMenuPanel + > div:not(.euiContextMenuPanel__title) { // I'm using this height so that the last element // is cut in half to make it clear to the user that // there is more content. max-height: 28.3rem; - ${useEuiOverflowScroll("y")} + ${useEuiOverflowScroll('y')} } .euiContextMenuPanel__title { background-color: ${euiTheme.colors