Apply a suggestion on comma key pressed
It would be great if UI will apply a suggesstion when comma pressed as like it works now with enter key.
For example, typing "jav,gr,int,win," will select Java, Gradle, IntelliJ and Windows.
I know one can use enter key for that, this just a small additional convenience for users :)
I played with this for a little bit a few days ago; there is no quick parameter that can be set in Select2 that enables this. This can be done, but it requires listening to select2 events and manually triggering the effect.
I re-looked into this when I was updating the site. Select 2 has a way to use arbitrary keys to select a tag, but that seems to just act as pressing down and not as pressing enter. I'll keep looking into whether or not this is possible.
Too lazy to fork... ~~but you can add a new if here~~ to listen for key code 188 (or whatever other keys you want) and select with $(".ignore-search").data('select2').results.trigger('results:select')
you will want to preventDefault on that event as well.
EDIT: not in that handler, but that bit of code will trigger selection
$(".ignore-search").on("select2:open", _=>{
$(".select2-search__field").keydown(e=>{
if ($(".ignore-search").data('select2').$results.attr('aria-expanded') === "true" && e.keyCode==188){
$(".ignore-search").data('select2').results.trigger('results:select');
e.preventDefault();
}
});
});
That should do it.
J'ai des difficulté avec Github. Je suis encore un novice en ce qui concerne le codage et j'avoue avoir de grande difficulté a mettre en œuvre les conseils de Github ou les tuto sur cette application de codage. Je vais metre du temps a comprendre et a utiliser Github comme il ce dois. Merci a vous et bonne année 2022
This issue is stale because it has been open for 30 days with no activity.