From 5ad3a7f7de0a771d7f8f7b2416d2fd5af71aa663 Mon Sep 17 00:00:00 2001 From: Patrick DeVries <39521214+PatrickDeVries@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:47:49 -0500 Subject: [PATCH 1/3] Update Select to allow users to disable dropdown portal --- packages/Select/src/Select.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/Select/src/Select.tsx b/packages/Select/src/Select.tsx index 8d22a2ac..69db3f95 100644 --- a/packages/Select/src/Select.tsx +++ b/packages/Select/src/Select.tsx @@ -55,6 +55,9 @@ export interface SelectProps { /** Whether or not to show the icon inside the * dropdown list if it's available */ showListIcon?: boolean; + /** Disables the component from appending the dropdown + * to the end of the body using ReactPortal */ + disablePortal?: boolean; } const Select: React.FunctionComponent = ({ @@ -72,6 +75,7 @@ const Select: React.FunctionComponent = ({ options, selectedOption, showListIcon = true, + disablePortal = false, ...rest }: SelectProps) => { const results = React.useMemo( @@ -290,6 +294,7 @@ const Select: React.FunctionComponent = ({ className={selectDropdownClassname} onClose={() => toggleMenu(true)} isReferenceWidth={!autoWidth} + disablePortal={disablePortal} isScrollable > From 62793d94c5562c10fb7d6d53f760b126722c61dd Mon Sep 17 00:00:00 2001 From: Patrick DeVries <39521214+PatrickDeVries@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:49:57 -0500 Subject: [PATCH 2/3] Add changeset --- .changeset/little-crabs-provide.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/little-crabs-provide.md diff --git a/.changeset/little-crabs-provide.md b/.changeset/little-crabs-provide.md new file mode 100644 index 00000000..f0ae99b4 --- /dev/null +++ b/.changeset/little-crabs-provide.md @@ -0,0 +1,5 @@ +--- +"@igloo-ui/select": minor +--- + +Add prop to disable dropdown portal and position options absolutely From 3d8145a8a0bf841862837637ab3a7f545244c074 Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Mon, 13 Jan 2025 14:01:13 -0500 Subject: [PATCH 3/3] Update .changeset/little-crabs-provide.md --- .changeset/little-crabs-provide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/little-crabs-provide.md b/.changeset/little-crabs-provide.md index f0ae99b4..beb7617e 100644 --- a/.changeset/little-crabs-provide.md +++ b/.changeset/little-crabs-provide.md @@ -2,4 +2,4 @@ "@igloo-ui/select": minor --- -Add prop to disable dropdown portal and position options absolutely +Added the `disablePortal` prop to disable dropdown portal, positioning options absolutely instead