A function that given input element, updates its width to fit its content.
npm install update-input-width !downloads 
A function that given an input element, updates its width to fit its content.
- Install by executing npm install update-input-width or yarn add update-input-width.
- Import by adding import updateInputWidth from 'update-input-width'.
- Use it by calling it with input element as an argument.
A function that given an input element, updates its width to fit its content by setting inline width CSS property.
#### Sample usage
``ts
import updateInputWidth from 'update-input-width';
updateInputWidth(myInput); // 42
`
or
`ts
import { updateInputWidth } from 'update-input-width';
updateInputWidth(myInput); // 42
`
A function that given HTML element returns font CSS shorthand property. Equal to Chrome-only code:
`ts`
window.getComputedStyle(element).font;
#### Sample usage
`ts
import { getFontShorthand } from 'update-input-width';
getFontShorthand(myInput); // 'normal normal 600 normal 20px / 25px Arial, sans-serif'
`
A function that given text and font CSS shorthand property returns text width in pixels.
#### Sample usage
`ts
import { measureText } from 'update-input-width';
measureText('hello', 'normal normal 600 normal 20px / 25px Arial, sans-serif'); // 42
``
The MIT License.
Wojciech Maj |