dhamaso / ufd

Automatically exported from code.google.com/p/ufd
GNU General Public License v2.0
0 stars 0 forks source link

Backspace won't focus on first relevant element #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use demonstration select with countries
2. Search for 'Alg', list is filtered as expected and 'Algeria' is selected.
3. Without loosing the focus from input field, delete the 'g' from searched 
string using the Backspace key.
4. 'Albania' becomes visible, but 'Algeria' is still the selected one.

What is the expected output? What do you see instead?
I expect that pressing the Backspace would select the first element from 
updated list. Backspacing the searched text will update the list, but keeps the 
first match from previous search, with longer text.

What version of the product are you using? On what operating system?
Firefox 37.0.1, UFD 0.6, Win 7 Prof 64

Please provide any additional information below.

Original issue reported on code.google.com by mat.hu...@gmail.com on 15 Apr 2015 at 8:55

GoogleCodeExporter commented 9 years ago
Ok, one way to fix it is to extend the condition on the line 438 to consider 
lastKey.
var oldActiveHidden =  active.hasClass(self.css.hidden) || self.lastKey == 8;

I'm also using extended condition on the line 441, as was proposed in issue #42
... && (searchText != "" || self.selectbox.get(0).options[0].value != "")
So now it handles deleting and backspacing with no problems.

Original comment by mat.hu...@gmail.com on 16 Apr 2015 at 8:52