Skip to content

Commit

Permalink
[Autocomplete] useLayoutEffect in combobox (#4015)
Browse files Browse the repository at this point in the history
* [Autocomplete] useLayoutEffect in combobox

* Adding to UNRELEASED
  • Loading branch information
Dominic McPhee authored and sylvhama committed Mar 26, 2021
1 parent e1eef7c commit c909219
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions UNRELEASED.md
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions 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';
Expand Down Expand Up @@ -240,7 +240,7 @@ export function ComboBox({
}
}, [selected, selectedOptions]);

useEffect(() => {
useLayoutEffect(() => {
let newNavigableOptions: (
| OptionDescriptor
| ActionListItemDescriptor
Expand Down

0 comments on commit c909219

Please sign in to comment.