I've enabled the "add" option on a Tom Select, which appears at the top of the dropdown when typing in a filter term. Eg:
new TomSelect(target, {
create: true
});
However, the closest matching option is selected (see pictured). I'd like the "add" option to be selected (highlighted/activated) by default. Is this possible?
I've figured out how to listen to the 'type'
event, which happens each time you type into the filter input, but am not sure how to select the "add" option.
Please try setting addPrecedence
to true
.
new TomSelect(target, {
create: true,
addPrecedence: true
});
Related documentation.