diff --git a/UNRELEASED.md b/UNRELEASED.md
index 20ce1ad3c68..7a6fbe9dfd5 100644
--- a/UNRELEASED.md
+++ b/UNRELEASED.md
@@ -20,6 +20,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- `PositionedOverlay` now exposes an imperative `forceReLayout()` API for programmatically triggering a re-render of the component ([#4385](https://github.com/Shopify/polaris-react/pull/4385))
- `Popover` now exposes an imperative `forceUpdatePosition()` API for programmatically triggering a re-render of the underlying overlay component ([#4385](https://github.com/Shopify/polaris-react/pull/4385))
- `PositionedOverlay` now exposes an imperative `forceUpdatePosition()` API for programmatically triggering a re-render of the component ([#4385](https://github.com/Shopify/polaris-react/pull/4385))
+- Added `wrapOverflow` prop to `AutocompleteProps` props to force text-breakword ([#4416](https://github.com/Shopify/polaris-react/pull/4416))
### Bug fixes
@@ -34,6 +35,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- Properly support `selected` prop for `Navigation.Item` when `url` prop is not specified ([#4375](https://github.com/Shopify/polaris-react/pull/4375))
- Fixed an accessibility bug in `Icon` where `aria-label` was used incorrectly ([#4414](https://github.com/Shopify/polaris-react/pull/4414))
- Fixed a bug in `Option` where the label would cause scrollbars to appear instead of wrapping ([#4411](https://github.com/Shopify/polaris-react/pull/4411))
+- Fixed a bug in `MappedOption` where the label will generate a scrollbar when the content is too long ([#4416](https://github.com/Shopify/polaris-react/pull/4416))
### Documentation
diff --git a/src/components/Autocomplete/Autocomplete.tsx b/src/components/Autocomplete/Autocomplete.tsx
index 7aa72583589..7b4bacf7a4b 100644
--- a/src/components/Autocomplete/Autocomplete.tsx
+++ b/src/components/Autocomplete/Autocomplete.tsx
@@ -30,7 +30,10 @@ export interface AutocompleteProps {
/** Allow more than one option to be selected */
allowMultiple?: boolean;
/** An action to render above the list of options */
- actionBefore?: ActionListItemDescriptor;
+ actionBefore?: ActionListItemDescriptor & {
+ /** Specifies that if the label is too long it will wrap instead of being hidden */
+ wrapOverflow?: boolean;
+ };
/** Display loading state */
loading?: boolean;
/** Indicates if more results will load dynamically */
diff --git a/src/components/Autocomplete/README.md b/src/components/Autocomplete/README.md
index 87ef09055e9..37525d582b5 100644
--- a/src/components/Autocomplete/README.md
+++ b/src/components/Autocomplete/README.md
@@ -700,6 +700,101 @@ function AutocompleteActionBeforeExample() {
}
```
+### Autocomplete with wrapping action
+
+Use to indicate there are no search results.
+
+```jsx
+function AutocompleteActionBeforeExample() {
+ const deselectedOptions = [
+ {value: 'rustic', label: 'Rustic'},
+ {value: 'antique', label: 'Antique'},
+ {value: 'vinyl', label: 'Vinyl'},
+ {value: 'vintage', label: 'Vintage'},
+ {value: 'refurbished', label: 'Refurbished'},
+ ];
+ const [selectedOptions, setSelectedOptions] = useState([]);
+ const [inputValue, setInputValue] = useState('');
+ const [options, setOptions] = useState(deselectedOptions);
+ const [loading, setLoading] = useState(false);
+
+ const updateText = useCallback(
+ (value) => {
+ setInputValue(value);
+
+ if (!loading) {
+ setLoading(true);
+ }
+
+ setTimeout(() => {
+ if (value === '') {
+ setOptions(deselectedOptions);
+ setLoading(false);
+ return;
+ }
+ const filterRegex = new RegExp(value, 'i');
+ const resultOptions = options.filter((option) =>
+ option.label.match(filterRegex),
+ );
+ setOptions(resultOptions);
+ setLoading(false);
+ }, 300);
+ },
+ [deselectedOptions, loading, options],
+ );
+
+ const updateSelection = useCallback(
+ (selected) => {
+ const selectedText = selected.map((selectedItem) => {
+ const matchedOption = options.find((option) => {
+ return option.value.match(selectedItem);
+ });
+ return matchedOption && matchedOption.label;
+ });
+ setSelectedOptions(selected);
+ setInputValue(selectedText[0]);
+ },
+ [options],
+ );
+
+ const textField = (
+