input-autowidth
Dependency-free JavaScript class to set an input's width based on its content
npm install input-autowidth
import InputAutoWidth from 'input-autowidth';
new InputAutoWidth(document.getElementById('username'), {
cache: false,
minWidth: null,
maxWidth: null
});
The returned class instance has the following properties and methods:
{
input: Element;
options: Object | undefined;
currentWidth: Number;
cache: Object;
eventHandler: Function;
measureString: Function;
trigger: Function;
destroy: Function;
}