Issue when clicking arrow when field is in focus

Jan 20, 2011 at 7:35 PM

Using both IE8 and FF 3.6.13

 

When the field(input) is already in focus, and I click the arrow, the results flash up for a split second and disappear.

If the field is in focus, and I click and hold the arrow for a second, then release, the results come up and stay up.

If the focus is on another field when I click the arrow as normal, the results come up and stay up.

 

 

Issue only seems to be when the box is already in focus.

 

Any ideas?


$('#fb').flexbox({
            "results": [
                         { "id": "1", "name": "Ant" },
                         { "id": "2", "name": "Bear" },
                         { "id": "3", "name": "Cat" },
                         { "id": "4", "name": "Dog" },
                         { "id": "5", "name": "Elephant" },
                         { "id": "6", "name": "Fox" },
                         { "id": "7", "name": "Guinea Pig" },
                         { "id": "8", "name": "Horse" },
                         { "id": "9", "name": "Iguana" },
                         { "id": "10", "name": "Jaguar" }
                     ], "total": 10
        }, { selectFirstMatch: false, matchAny: false, autoCompleteFirstMatch: false });

Jan 20, 2011 at 7:55 PM

As per usual - I spend hours looking at something, then minutes after posting I work it out.

 

It's around line 79:

 

.focus(function(e) {
                $(this).removeClass('watermark');
            })
            .blur(function(e) {
                if (this.value === '') $hdn.val('');
                setTimeout(function()
                { if (!$input.data('active')) hideResults(); }, 50);
            })
            .keydown(processKeyDown);

 

The line with "50" in it used to be 200. When I cranked it down to 50 it behaved as expected. I guess this is some kind of delay. 200 being 200ths of a second?

 

Jan 20, 2011 at 7:55 PM

Sorry, 200ms?

Coordinator
Jan 20, 2011 at 8:53 PM

Thanks for pointing out the issue. And yes, it is a delay, but it was originally designed to fix an issue when backspacing inside the input, which sometimes triggered the autocomplete too quickly.

If you find that you have no problem backspacing when you find a match, let me know, and I’ll run some tests myself. If all is well, I’ll change that value (and/or make it configurable).

Noah

From: skidmerc [email removed]
Sent: Thursday, January 20, 2011 12:56 PM
To: Noah Heldman
Subject: Re: Issue when clicking arrow when field is in focus [flexbox:242653]

From: skidmerc

Sorry, 200ms?