diff --git a/UNRELEASED.md b/UNRELEASED.md index 2f4b02db87b..2009fb22ec3 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -20,6 +20,15 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t - Fixed overly dark `bottom-border` on `DataTable` header cell and total cell ([#4975](https://github.com/Shopify/polaris-react/pull/4975)) - Removed `min-height` on `Autocomplete` `action` ([#4977](https://github.com/Shopify/polaris-react/pull/4977)) - Fixed `focus-ring` on `Banner` `secondaryAction` ([#4997](https://github.com/Shopify/polaris-react/pull/4997)) +- Fixed a bug where remove button could shrink in the `Tag` component ([#4816](https://github.com/Shopify/polaris-react/issues/4816)) +- Fixed incorrect `Popover` position in `Combobox` when an element is conditionally rendered before the `Combobox` ([#4825](https://github.com/Shopify/polaris-react/pull/4825)) +- Reverted the deprecation of the "attention" `status` in `Badge` ([#4840](https://github.com/Shopify/polaris-react/pull/4840)) +- Fixed an issue where the `MutationObserver` of the `PositionedOverlay` was calling setState on an unmounted component ([#4869](https://github.com/Shopify/polaris-react/pull/4869)); +- Fixed a color contrast issue in `FileUpload` ([#4875](https://github.com/Shopify/polaris-react/pull/4875)) +- Fixed a bug where a checkbox showed on an `Autocomplete` action when `allowMultiple` is true ([#4886](https://github.com/Shopify/polaris-react/pull/4886)) +- Fixed a bug where the `Listbox.Action` was not treated like an action when used outside `Autocomplete` ([#4893](https://github.com/Shopify/polaris-react/pull/4893)) +- Fixed a bug where the `Checkbox` in a `Combobox` with `allowMultiple` would steal focus and close the `Popover` when clicked ([#4895](https://github.com/Shopify/polaris-react/pull/4895)) +- Fixed an issue where `TextField` was the wrong height on initial render ([#4903](https://github.com/Shopify/polaris-react/pull/4903)) ### Documentation diff --git a/src/components/TextField/TextField.tsx b/src/components/TextField/TextField.tsx index ccf7b461034..cf5d46fd5ae 100644 --- a/src/components/TextField/TextField.tsx +++ b/src/components/TextField/TextField.tsx @@ -432,6 +432,7 @@ export function TextField({ pattern, inputMode, type: inputType, + rows: getRows(multiline), 'aria-describedby': describedBy.length ? describedBy.join(' ') : undefined, 'aria-labelledby': labelledBy.join(' '), 'aria-invalid': Boolean(error), @@ -531,3 +532,9 @@ function normalizeAriaMultiline(multiline?: boolean | number) { ? {'aria-multiline': true} : undefined; } + +function getRows(multiline?: boolean | number) { + if (!multiline) return undefined; + + return typeof multiline === 'number' ? multiline : 1; +}