From 160bcbe9df75e77d9d8acc8fb932b2a70f17b5e6 Mon Sep 17 00:00:00 2001 From: johannbm Date: Wed, 30 Aug 2023 10:53:05 +0200 Subject: [PATCH 1/2] Remove explicit menuPortalTarget for react-select --- apps/frontend/src/components/SearchBar.tsx | 1 - .../frontend/src/components/select/CustomSelectComponents.tsx | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/frontend/src/components/SearchBar.tsx b/apps/frontend/src/components/SearchBar.tsx index 3a1516ff7..42d370d1f 100644 --- a/apps/frontend/src/components/SearchBar.tsx +++ b/apps/frontend/src/components/SearchBar.tsx @@ -72,7 +72,6 @@ export function SearchBar() { isClearable={false} loadOptions={searchRessurs} loadingMessage={() => "Søker..."} - menuPortalTarget={document.body} noOptionsMessage={({ inputValue }) => inputValue.length < RESOURCE_SEARCH_TERM_LOWER_LENGTH_LIMIT ? "Skriv minst 3 tegn for å søke" diff --git a/apps/frontend/src/components/select/CustomSelectComponents.tsx b/apps/frontend/src/components/select/CustomSelectComponents.tsx index 233cdf69b..63610e29c 100644 --- a/apps/frontend/src/components/select/CustomSelectComponents.tsx +++ b/apps/frontend/src/components/select/CustomSelectComponents.tsx @@ -67,7 +67,6 @@ export function AsyncSearch< components={{ MenuList: CustomMenuList, ...properties.components }} isClearable loadingMessage={() => "Søker..."} - menuPortalTarget={document.body} styles={{ ...commonSelectOverwriteStyles, dropdownIndicator: (base) => ({ ...base, display: "none" }) }} /> ); @@ -153,7 +152,7 @@ export function BasicSelect< escapeClearsValue isClearable isSearchable - menuPortalTarget={document.body} + // menuPortalTarget={document.body} placeholder={properties.placeholder ?? ""} styles={commonSelectOverwriteStyles} /> @@ -173,7 +172,6 @@ export function BasicCreatableSelect< escapeClearsValue isClearable isSearchable - menuPortalTarget={document.body} placeholder={properties.placeholder ?? ""} styles={commonSelectOverwriteStyles} /> From acd6b9b632cab0bd4f43537cc73e5069b42af14a Mon Sep 17 00:00:00 2001 From: johannbm Date: Wed, 30 Aug 2023 11:15:25 +0200 Subject: [PATCH 2/2] delete, not comment out --- apps/frontend/src/components/select/CustomSelectComponents.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/frontend/src/components/select/CustomSelectComponents.tsx b/apps/frontend/src/components/select/CustomSelectComponents.tsx index 63610e29c..f889fc8ff 100644 --- a/apps/frontend/src/components/select/CustomSelectComponents.tsx +++ b/apps/frontend/src/components/select/CustomSelectComponents.tsx @@ -152,7 +152,6 @@ export function BasicSelect< escapeClearsValue isClearable isSearchable - // menuPortalTarget={document.body} placeholder={properties.placeholder ?? ""} styles={commonSelectOverwriteStyles} />