remove text from tag choice after selection - fixes #4076

This commit is contained in:
Kevin Papst
2023-08-04 13:03:11 +02:00
parent b831532323
commit 0a0ffb4ac9
7 changed files with 15 additions and 5 deletions

View File

@@ -41,6 +41,11 @@ export default class KimaiAutocomplete extends KimaiFormPlugin {
}
new TomSelect(node, {
// see https://github.com/orchidjs/tom-select/issues/543#issuecomment-1664342257
onItemAdd: function(){
// remove remaining characters from input after selecting an item
this.setTextboxValue('');
},
// if there are more than 500, they need to be found by "typing"
maxOptions: 500,
// the autocomplete is ONLY used, when the user can create tags

View File

@@ -71,6 +71,11 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
*/
let options = {
// see https://github.com/orchidjs/tom-select/issues/543#issuecomment-1664342257
onItemAdd: function(){
// remove remaining characters from input after selecting an item
this.setTextboxValue('');
},
lockOptgroupOrder: true,
allowEmptyOption: !isRequired,
hidePlaceholder: false,