From 1d4e33102487f09c35b873d5760fc958f7db4e30 Mon Sep 17 00:00:00 2001 From: Dominic McPhee Date: Wed, 24 Feb 2021 09:59:36 -0500 Subject: [PATCH 1/2] [Autocomplete] useLayoutEffect in combobox --- src/components/Autocomplete/components/ComboBox/ComboBox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Autocomplete/components/ComboBox/ComboBox.tsx b/src/components/Autocomplete/components/ComboBox/ComboBox.tsx index 6c2ce09138d..cb05a174421 100644 --- a/src/components/Autocomplete/components/ComboBox/ComboBox.tsx +++ b/src/components/Autocomplete/components/ComboBox/ComboBox.tsx @@ -1,4 +1,4 @@ -import React, {useState, useEffect, useCallback} from 'react'; +import React, {useState, useEffect, useLayoutEffect, useCallback} from 'react'; import {useUniqueId} from '../../../../utilities/unique-id'; import {useToggle} from '../../../../utilities/use-toggle'; @@ -240,7 +240,7 @@ export function ComboBox({ } }, [selected, selectedOptions]); - useEffect(() => { + useLayoutEffect(() => { let newNavigableOptions: ( | OptionDescriptor | ActionListItemDescriptor From ffff493b87e282db4d5b14fccb69ed0f51e4c8f3 Mon Sep 17 00:00:00 2001 From: Dominic McPhee Date: Wed, 24 Feb 2021 10:06:29 -0500 Subject: [PATCH 2/2] Adding to UNRELEASED --- UNRELEASED.md | 1 + 1 file changed, 1 insertion(+) diff --git a/UNRELEASED.md b/UNRELEASED.md index 2c880bddfde..0ae5fb8b598 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -33,6 +33,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f - Fixed `IndexTable` bug where bulk actions are operable when no rows are selected ([#4009](https://github.com/Shopify/polaris-react/pull/4009)) - Fixed `CheckableButton` missing border when focused ([#3987](https://github.com/Shopify/polaris-react/issues/3987)) - Removed all `outline` and `border`instances of `-ms-high-contrast` as it is non-standard ([#3962](https://github.com/Shopify/polaris-react/pull/3962)). +- Fixed `Autocomplete` popover height not being calculated correctly ([#4015](https://github.com/Shopify/polaris-react/pull/4015)). ### Documentation