example: Multiple select boxes on https://select2.github.io/examples.html
1. click box
2. select Alaska
3. Select Hawaii
4. Click box like you were going to enter a 3rd state
5. hit backspace.
6. Note that the cursor doesn't go back in the text box
7. Hit Backspace a 2nd time.
This primarily occurs if the user is trying to erase the existing selections using backspace. If they just treat it like a text box and hit backspace several times to clear it, they wind up navigating back out of the page.
Expected behavior: The text box that the user is typing in should retain focus.
Here's the changes I made.
Index: select2.js
===================================================================
@@ -1789,6 +1789,9 @@
self.$search.attr('tabindex', 0);
self.$search.focus();
+ window.setTimeout(function () {
+ self.$search.focus();
+ }, 0);
});
container.on('close', function () {
@@ -1887,7 +1890,8 @@
this.trigger('open');
- this.$search.val(item.text + ' ');
+ this.$search.val(item.text);
+ this.resizeSearch();
};
Search.prototype.resizeSearch = function () {
--
You received this message because you are subscribed to the Google Groups "select2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
To post to this group, send email to sel...@googlegroups.com.
Visit this group at http://groups.google.com/group/select2.
For more options, visit https://groups.google.com/d/optout.