Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After selecting an item, the typed characters are still visible #543

Closed
hrauch opened this issue Dec 26, 2022 · 5 comments
Closed

After selecting an item, the typed characters are still visible #543

hrauch opened this issue Dec 26, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@hrauch
Copy link

hrauch commented Dec 26, 2022

I'm using the mutliple select mode and it does work very well. But after selectng the right word in my list of tags, the characters I typed are shown behind the tag. If I am searching for similar words, this is fine. But if I want to select another quite different tag, it would be better if the typed characters were not shown.
May be an option "clear input after selecting" would be possible.

@hrauch hrauch added the bug Something isn't working label Dec 26, 2022
@kevinpapst
Copy link

Yes please, a setting would be great here, as this is really a disturbing feature.

@bdkruse
Copy link

bdkruse commented Aug 3, 2023

While I agree this should be default behavior, the example on the Tom Select landing page solved this issue for me. Here is how the codepen example used onItemAdd and setTextboxValue to clear the typed characters.

new TomSelect("#select-tags",{
  onItemAdd:function(){
    this.setTextboxValue('');
  }
}

@kevinpapst
Copy link

Wow, that is simple, thanks for sharing @bdkruse 👍

It does the job, let's hope it has no strange side effects...

@jclusso
Copy link

jclusso commented Aug 12, 2023

@bdkruse has a good start but I needed to add this.refreshOptions(false) otherwise the list was still being filtered.

onItemAdd: function() {
  this.setTextboxValue('');
  this.refreshOptions(false);
}

@adrienbrault
Copy link

@jclusso Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants