<textarea /> component for React which grows with content
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] over 1 year ago
#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 through package.json#exports
.
#373 05b014a
Thanks @Andarist! - This package no longer depends on process.env.NODE_ENV
. To get dev-only warnings you have to configure your bundler/runtime to use the development
condition.
d33b120
Thanks @ArnaudRinquin! - Add a guard against potentially missing documents.fonts
Published by github-actions[bot] over 1 year ago
#353 19aead9
Thanks @knownasilya! - Workaround for Firefox scrollHeight
bug affecting textarea's height on a dynamic toggle
#362 2301195
Thanks @ArnaudRinquin! - Support automatic resizing when a custom fonts ends up loading
Published by github-actions[bot] almost 2 years ago
#354 41d10b2
Thanks @Andarist! - exports
field has been added to the package.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.
Published by github-actions[bot] over 2 years ago
9124bbf
Thanks @rebelliard! - Add React 18 to the allowed peer dependency range.Published by github-actions[bot] over 3 years ago
0d7ac21
#326 Thanks @karlingen! - Account for word-break
property when calculating the height.
6336448
#327 Thanks @circlingthesun! - Fixed the tabindex
attribute name that is set on the hidden textarea used for height calculations.
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
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.Published by github-actions[bot] almost 4 years ago
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
db872f0
Thanks @Andarist! - TextareaAutosizeProps
are now based on React.TextareaHTMLAttributes<HTMLTextAreaElement>
instead of JSX.IntrinsicElements['textarea']
. The latter one includes a type for ref
attribute and it being included as part of TextareaAutosizeProps
has caused problems when using TextareaAutosizeProps
to declare wrapper components. This is also more semantically correct as ref
shouldn't be a part of props
. It's rather accepted by a particular JSX element and in case of the react-textarea-autosize
this is the type of the exported component which is React.ForwardRefExoticComponent<TextareaAutosizeProps>
(a result of React.forwardRef
call).
61ca826
Thanks @Andarist! - maxHeight
and minHeight
has been disallowed as part of TextareaAutosizeProps['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 with box-sizing: border-box;
.
1d1bba2
#265 Thanks @SimenB! - Exported TextareaAutosizeProps
type for convenience.
da960f4
Thanks @Andarist! - Fixed an issue with internal cache not being populated correctly when using cacheMeasurements
prop.
^16.8.0
.ref
prop to get access to the underlaying textarea
element as React.forwardRef
is being used now. The support for innerRef
has been completely removed.useCacheForDOMMeasurements
prop has been renamed to cacheMeasurements
.onHeightChange
callback no longer receives the second argument. It was the component's instance (its this
), but as the component is now implemented using hooks there no longer is any instance that could be given to a consumer like that.props.style.maxHeight
and props.style.minHeight
values. If you need to control those boundaries you should use maxRows
and minRows
props respectively.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.Published by Andarist over 6 years ago
propTypes
in production builds, some micro optimizations"browser"
field now with slightly lighter code for browsersvalueRowCount
property on component's instance holding total row count (including those over maxRows
)onChange
being called with second argument - this
of the componentPublished by Andarist over 6 years ago
Moved height recalculation to componentDidUpdate
hook - should behave the same for all compatible React versions and at the same time won't be using deprecated componentWillReceiveProps
hook.
Published by Andarist over 6 years ago
Published by Andarist over 6 years ago
No actual changes, sort of a bug fix - documented way of requiring the package in CJS env was to require('react-textarea-autosize').default
, but accidentally it got broken way over half a year ago in 5.1.0 (28 July 2017). Since that version CJS envs could do require('react-textarea-autosize')
(without additional .default
).
Interop between those 2 module formats is tricky if we do not provide additional interop helpers (that were omitted in "broken" versions) when bundling. It caused some issues in mixed SSR / browser development, so it got fixed, but due to long-standing nature of this "bug" it got decided to release this as major version if by any chance somebody has relied on the broken behaviour.