fnagel/jquery-ui

Type-ahead selection timeout issue

sronsiek opened this issue · 4 comments

On http://jsfiddle.net/3BuK2/2/ I have observed the following behaviour:

In the 'lengthened' jsfiddle menu containing all the extra options beginning with 'B', click to open the drop-down. Now hit the following keys at approx half second intervals:

b b b b a a a a

As expected, the selection starts with the first option beginning with b, and cycles through the remaining options starting with b. However when the first 'non-b' char is hit, the selection remains frozen.

If I wait a couple of seconds - normal service is resumed - typing 'a' jumps to the first 'a' selection.

I guess that the expected behavior for the current implementation. With the key codes above you are basically searching for a word with "bbbba" which wont be found as its not existing in the select. At least in FF this is the native select behavior.

Can you give me a real world example why this is a issue? It seems the above used key order is a theoretical one.

On 13/06/14 00:37, Felix Nagel wrote:

I guess that the expected behavior for the current implementation.
With the key codes above you are basically searching for a word with
"bbbba" which wont be found as its not existing in the select. At
least in FF this is the native select behavior.

Can you give me a real world example why this is a issue? It seems the
above used key order is a theoretical one.

We difeer in the way we see how it should work:

I believe it should depend on the how quickly you type!

With very short intervals between keys, you get the behaviour you describe:
If I enter 'med' to locate 'Medium', I enter the key sequence in quick
succession.

If I enter keys more slowly - I expect to walk through options by
initial letter.
Hence entering "bbbba" more slowly I expect the walk through the first 4
items beginning with 'b' - then jump to the first option beginning with 'a'.

Do this very slowly & you see it does this (~1.5s intervals). But
around half second
intervals it does walk through options sarting with 'b' - but freezes
when you
hit a non-b char.


Reply to this email directly or view it on GitHub
#341 (comment).

Ok, I understand what you would like to achieve.

How does a native select achieve this? Does it work for native selects at all?
If so, I assume the browser uses some OS specific setting?

The default threshold for the interval is 1s and can be controlled via typeAhead option.

To achieve a behavior as you expect we would need to implement some mechanism to determine the keydown speed of the user. I'm not quite sure on how to do this in a sane way.

I'm sorry, but this seems to be out of scope for our agreement and I'm not sure if it would be more reasonable to add this as a feature request for the upcoming selectmenu widget. Or better: for menu widget as the new selectmenu utilizes menu widget like autocomplete already does.

Closed. Please reopen if needed.