import Input from 'uc-input-contenteditable';
const elDisplay = get('#display');
const input = new Input({
onChange: val => {
console.log('val', val);
}
}).appendTo(elDisplay);
This component follows Unchained UI guidelines.
Constructor options:
- el – HTLMElement that should become editable.
- limit — number, the text limit
- debounce – number, default 500ms. Debounce onChange calls
- onChange — function, callback will be called when value is changed
- slugify — boolean, slugify input
- trim — boolean, trim input
if val
is undefined returns current value, otherwise sets the value.
Sets the focus.
Removes focus.
Indicates an error by adding error
class.
Removes the component.
Adds the transform function to the end of transformation chain.
Adds the transform function to the begining of transformation chain.
License MIT
© velocityzen