Choices/assets/scripts/src/components/input.js

28 lines
471 B
JavaScript
Raw Normal View History

2017-08-17 14:50:14 +02:00
/**
* Dropdown
*/
export default class Input {
constructor(instance, element, classNames) {
this.instance = instance;
this.element = element;
this.classNames = classNames;
}
2017-08-21 09:53:19 +02:00
/**
* Set value of input to blank
* @return {Object} Class instance
* @public
*/
clear(setWidth = true) {
if (this.element.value) {
this.element.value = '';
}
if (setWidth) {
this._setInputWidth();
}
return this.instance;
}
2017-08-17 14:50:14 +02:00
}