- #409
8c47e31
Thanks @Andarist! - Fixed an issue with resize not happening after the containing form being reset
- #401
4a34e1b
Thanks @olee! - Add missingwordSpacing
andscrollbarGutter
as properties that can impact sizing
- #397
bf3cad8
Thanks @Oyveloper! - Forcedisplay: block
for the hidden textarea to prevent other styles from overriding it and thus breaking the resizing functionality
- #386
b3dc597
Thanks @Andarist! - Distribute completely separate files for theworker
condition to avoid bundlers from aliasing files targeting node to the ones targeting browsers through thepackage.json#browser
alias field.
- #377
4087205
Thanks @Andarist! - The providedonChange
will get forwarded again to the underlying<textarea/>
on the server side.
- #373
05b014a
Thanks @Andarist! - Compatibility with node's ESM has been improved.import TextareaAutosize from 'react-textarea-autosize';
was always meant to provide you the default export of this package (the exported component) and now node should load it this way.
- #373
05b014a
Thanks @Andarist! - SSR environments should now be able to pick smaller bundles throughpackage.json#exports
.
- #373
05b014a
Thanks @Andarist! - This package no longer depends onprocess.env.NODE_ENV
. To get dev-only warnings you have to configure your bundler/runtime to use thedevelopment
condition.
- #370
d33b120
Thanks @ArnaudRinquin! - Add a guard against potentially missingdocuments.fonts
- #353
19aead9
Thanks @knownasilya! - Workaround for FirefoxscrollHeight
bug affecting textarea's height on a dynamic toggle
- #362
2301195
Thanks @ArnaudRinquin! - Support automatic resizing when a custom fonts ends up loading
-
#354
41d10b2
Thanks @Andarist! -exports
field has been added to thepackage.json
manifest.Thanks to this, the package now includes a
worker
condition that can be utilized by properly configured bundlers when targeting worker-like environments. It fixes the issue with browser-specific files being prioritized by some bundlers when targeting workers.
- #341
9124bbf
Thanks @rebelliard! - Add React 18 to the allowed peer dependency range.
0d7ac21
#326 Thanks @karlingen! - Account forword-break
property when calculating the height.
6336448
#327 Thanks @circlingthesun! - Fixed thetabindex
attribute name that is set on the hidden textarea used for height calculations.
3c71884
#311 Thanks @Andarist! - ChangedTextareaAutosizeProps
to a TS interface which fixes the problem of "resolved" being type alias being inlined in the emitted types declaration which could cause incompatibilities with some versions of@types/react
.
49d7d04
#305 Thanks @mxschmitt! - Moved internal'resize'
listener to the layout effect since React 17 calls cleanups of regular effects asynchronously. This ensures that we don't ever try to access the already unmounted ref in our listener.
a1fc99f
#284 Thanks @emmenko! - Added{ rowHeight: number }
as a second parameter to theonHeightChange
callback. This is useful to construct custom behaviors according to the height values.
b7c227a
#280 Thanks @emdotem! - Fixed a broken call tosetProperty
that has prevented the library to work correctly.
db872f0
Thanks @Andarist! -TextareaAutosizeProps
are now based onReact.TextareaHTMLAttributes<HTMLTextAreaElement>
instead ofJSX.IntrinsicElements['textarea']
. The latter one includes a type forref
attribute and it being included as part ofTextareaAutosizeProps
has caused problems when usingTextareaAutosizeProps
to declare wrapper components. This is also more semantically correct asref
shouldn't be a part ofprops
. It's rather accepted by a particular JSX element and in case of thereact-textarea-autosize
this is the type of the exported component which isReact.ForwardRefExoticComponent<TextareaAutosizeProps>
(a result ofReact.forwardRef
call).
61ca826
Thanks @Andarist! -maxHeight
andminHeight
has been disallowed as part ofTextareaAutosizeProps['style']
. The intention to do that was there since the v8 release but it was not implemented correctly and allowed those to slip into the mentioned type.
2307033
#266 Thanks @vlazh! - Fixed a regression with calculating too high height for textareas withbox-sizing: border-box;
.
da960f4
Thanks @Andarist! - Fixed an issue with internal cache not being populated correctly when usingcacheMeasurements
prop.
- The package has been rewritten in TypeScript so type definitions are now included in the package itself. There is no need to install separate types from the DefinitelyTyped.
- At the same time the package internals have been rewritten to use React's hooks API. This means that the peer dependency requirement for React version had to be changed to
^16.8.0
. - You can now use
ref
prop to get access to the underlayingtextarea
element asReact.forwardRef
is being used now. The support forinnerRef
has been completely removed. useCacheForDOMMeasurements
prop has been renamed tocacheMeasurements
.onHeightChange
callback no longer receives the second argument. It was the component's instance (itsthis
), but as the component is now implemented using hooks there no longer is any instance that could be given to a consumer like that.- Removed handling
props.style.maxHeight
andprops.style.minHeight
values. If you need to control those boundaries you should usemaxRows
andminRows
props respectively.
- The height is being set now directly on the underlaying
textarea
element and not caused by updating internal state and this triggering React's rerender. This shouldn't make for any observable difference for consumers of this package.