Allow Users to Change Focus without Adding Tag #19
Unanswered
kirankunigiri
asked this question in
Q&A
Replies: 1 comment
-
You can disable that, but this is a bit hacky. Hopefully you don’t see any glitch in the UI because of the last tag removal on every blur event: let hasValue = false;
picker.input.addEventListener('input', function() {
hasValue = !!this.textContent;
});
picker.on('blur', function(tags, count) {
if (0 === count || !hasValue) {
return; // Ignore if no tags available or input has no value
}
let lastTag = tags[count - 1];
this.let(lastTag); // Remove the last tag
this.input.textContent = lastTag; // Put the last tag back to the input
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, whenever the user clicks outside of the input area or presses tab to change focus, a new tag will automatically be inserted. Is there a way to disable this? I want users to keep their current text when they click off, instead of automatically converting it. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions