diff --git a/CHANGELOG.md b/CHANGELOG.md index 770cec672..adf4f6236 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Reactist follows [semantic versioning](https://semver.org/) and doesn't introduce breaking changes (API-wise) in minor or patch releases. However, the appearance of a component might change in a minor or patch release so keep an eye on redesigns and make sure your app still looks and feels like you expect it. +# next + +- [Fix] `TextArea` with `autoExpand={true}` applies it initially, acknowledging any initial value that the field may have. + # v21.0.0 - [BREAKING] `TextField`'s `startIcon` property is now renamed `startSlot`. diff --git a/src/text-area/text-area.stories.tsx b/src/text-area/text-area.stories.tsx index 2553c0244..4f037b8be 100644 --- a/src/text-area/text-area.stories.tsx +++ b/src/text-area/text-area.stories.tsx @@ -200,3 +200,40 @@ AutoExpandStory.argTypes = { 'small', ), } + +export function AutoExpandWithInitialValueStory(props: PartialProps) { + const initialValue = + 'This is some text that takes up multiple lines. It should cause the textarea to render initially as large as needed to fit this text, even if its initial rows are not enough.' + const [value, setValue] = React.useState(initialValue) + + return ( + +