calculate-textarea-height

v1.0.1arrow_drop_down
v1.0.1
v1.0.0
STATUS
Passing
DOWNLOADS
6
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
6 years ago
SIZE
2 KB
Returns an object containing the computed style and the combined vertical padding size, combined vertical border size and box-sizing value.
1 contributor
Install calculate-textarea-height as a package?
Copied
npm i @bit/tomlandau.belle.utils.calculate-textarea-height
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
chevron_left
chevron_right

Returns an object containing the computed style and the combined vertical padding size, combined vertical border size and box-sizing value.

This style is returned as string to be applied as attribute of an element.

Returns an object containing height of the textare as if all the content would be visible. The minHeight & maxHeight are in the object as well and are based on minRows & maxRows.

In order to improve the performance a hidden textarea is added to the DOM and used for further caluculations. In addition the styling of each textarea is cached to improve performance.

Help and resources