tom-select
Version:
Tom Select is a versatile and dynamic <select> UI control. Forked from Selectize.js to provide a framework agnostic autocomplete widget with native-feeling keyboard navigation, it's useful for tagging, contact lists, country selectors, etc.
24 lines • 685 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
function default_1(userOptions) {
const self = this;
const options = Object.assign({
text: (option) => {
return option[self.settings.labelField];
}
}, userOptions);
self.on('item_remove', function (value) {
if (!self.isFocused) {
return;
}
if (self.control_input.value.trim() === '') {
var option = self.options[value];
if (option) {
self.setTextboxValue(options.text.call(self, option));
}
}
});
}
;
//# sourceMappingURL=plugin.js.map