react-textarea-autosize

<textarea /> component for React which grows with content

MIT License

Downloads
10.7M
Stars
2.1K
Committers
61

Bot releases are visible (Hide)

react-textarea-autosize - v8.5.3 Latest Release

Published by github-actions[bot] about 1 year ago

Patch Changes

  • #386 b3dc597 Thanks @Andarist! - Distribute completely separate files for the worker condition to avoid bundlers from aliasing files targeting node to the ones targeting browsers through the package.json#browser alias field.
react-textarea-autosize - v8.5.2

Published by github-actions[bot] over 1 year ago

Patch Changes

react-textarea-autosize - v8.5.1

Published by github-actions[bot] over 1 year ago

Patch Changes

  • #377 4087205 Thanks @Andarist! - The provided onChange will get forwarded again to the underlying <textarea/> on the server side.
react-textarea-autosize - v8.5.0

Published by github-actions[bot] over 1 year ago

Minor Changes

  • #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.

Patch Changes

react-textarea-autosize - v8.4.1

Published by github-actions[bot] over 1 year ago

Patch Changes

react-textarea-autosize - v8.4.0

Published by github-actions[bot] almost 2 years ago

Minor Changes

  • #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.

react-textarea-autosize - v8.3.4

Published by github-actions[bot] over 2 years ago

Patch Changes

react-textarea-autosize - v8.3.3

Published by github-actions[bot] over 3 years ago

Patch Changes

react-textarea-autosize - https://github.com/Andarist/react-textarea-autosize/releases/tag/v8.3.2

Published by github-actions[bot] over 3 years ago

Patch Changes

  • 3c71884 #311 Thanks @Andarist! - Changed TextareaAutosizeProps 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.
react-textarea-autosize - https://github.com/Andarist/react-textarea-autosize/releases/tag/v8.3.1

Published by github-actions[bot] over 3 years ago

Patch Changes

  • 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.
react-textarea-autosize - https://github.com/Andarist/react-textarea-autosize/releases/tag/v8.3.0

Published by github-actions[bot] almost 4 years ago

Minor Changes

  • a16a46d #296 Thanks @RDIL! - Allow React 17 in the specified peer dependency range.
react-textarea-autosize - https://github.com/Andarist/react-textarea-autosize/releases/tag/v8.2.0

Published by github-actions[bot] over 4 years ago

Minor Changes

  • a1fc99f #284 Thanks @emmenko! - Added { rowHeight: number } as a second parameter to the onHeightChange callback. This is useful to construct custom behaviors according to the height values.
react-textarea-autosize - https://github.com/Andarist/react-textarea-autosize/releases/tag/v8.1.1

Published by github-actions[bot] over 4 years ago

Patch Changes

  • b7c227a #280 Thanks @emdotem! - Fixed a broken call to setProperty that has prevented the library to work correctly.
react-textarea-autosize - https://github.com/Andarist/react-textarea-autosize/releases/tag/v8.1.0

Published by github-actions[bot] over 4 years ago

Minor Changes

  • 722e10a #278 Thanks @emdotem! - Set inline style's height property with the "important" priority.

Patch Changes

  • 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.

react-textarea-autosize -

Published by github-actions[bot] over 4 years ago

Patch Changes

  • 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.

react-textarea-autosize -

Published by github-actions[bot] over 4 years ago

Major Changes

  • 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 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.
  • Removed handling props.style.maxHeight and props.style.minHeight values. If you need to control those boundaries you should use maxRows and minRows props respectively.

Minor Changes

  • 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.
react-textarea-autosize - v7.0.0

Published by Andarist over 6 years ago

  • size improvements - removing propTypes in production builds, some micro optimizations
  • distributing "browser" field now with slightly lighter code for browsers
  • valueRowCount property on component's instance holding total row count (including those over maxRows)
  • onChange being called with second argument - this of the component
react-textarea-autosize - v6.1.0

Published 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.

react-textarea-autosize - v6.0.1

Published by Andarist over 6 years ago

  • Bail out from calculating dimenions for detached nodes (fixes #173)
react-textarea-autosize - v6.0.0

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.

Package Rankings
Top 0.79% on Npmjs.org
Top 24.44% on Repo1.maven.org
Badges
Extracted from project README
npm version npm