From 5b99d8dd112554d2fe1842af5d3ed5039c1965d7 Mon Sep 17 00:00:00 2001 From: Pramod S <87521752+pramodcog@users.noreply.github.com> Date: Mon, 4 Nov 2024 09:57:32 +0100 Subject: [PATCH] fix(react-components): settings Menu UI going out of the viewer (#4841) * fixed Settings Menu UI going out of the viewer * added max-height for setting menu and fixed layer menu alignment * bumped react-components to v0.63.1 --- react-components/package.json | 2 +- .../src/components/Architecture/FilterButton.tsx | 15 +++++++++------ .../components/Architecture/SettingsButton.tsx | 14 ++++++++++---- .../RevealToolbar/LayersButton/LayersButton.tsx | 12 ++++++++++-- .../components/RevealToolbar/SettingsButton.tsx | 12 ++++++++++-- react-components/src/components/constants.ts | 2 +- 6 files changed, 41 insertions(+), 16 deletions(-) diff --git a/react-components/package.json b/react-components/package.json index 506ba607140..0dbe39e435d 100644 --- a/react-components/package.json +++ b/react-components/package.json @@ -1,6 +1,6 @@ { "name": "@cognite/reveal-react-components", - "version": "0.64.0", + "version": "0.64.1", "exports": { ".": { "import": "./dist/index.js", diff --git a/react-components/src/components/Architecture/FilterButton.tsx b/react-components/src/components/Architecture/FilterButton.tsx index 1b71cd997f2..177e1d2372c 100644 --- a/react-components/src/components/Architecture/FilterButton.tsx +++ b/react-components/src/components/Architecture/FilterButton.tsx @@ -89,6 +89,7 @@ export const FilterButton = ({ label={label} selectedLabel={selectedLabel} isOpen={isOpen} + setOpen={setOpen} PanelContent={PanelContent} /> ) : ( @@ -133,8 +134,7 @@ const FilterMenu = ({
+ ); }; @@ -346,3 +346,9 @@ const StyledSlider = styled(Slider)` display: flex; justify-content: space-around; `; + +const StyledMenu = styled(Menu)` + z-index: 998 !important; + max-height: 300px !important; + overflow-y: auto !important; +`; diff --git a/react-components/src/components/RevealToolbar/LayersButton/LayersButton.tsx b/react-components/src/components/RevealToolbar/LayersButton/LayersButton.tsx index 4d6302ad900..57933dbf477 100644 --- a/react-components/src/components/RevealToolbar/LayersButton/LayersButton.tsx +++ b/react-components/src/components/RevealToolbar/LayersButton/LayersButton.tsx @@ -51,7 +51,11 @@ export const LayersButton = ({ return ( <> -