This project is read-only.

Autocomplete Focus Issue

Aug 1, 2013 at 10:04 AM

When I click into an autocomplete field the first character is not registered. For example, if I want to type in "test" I have to type in "ttest" to get "test" into the field. If I type "test", the text in the the field is "est".

Any ideas?

Aug 1, 2013 at 10:16 AM
I have experienced the same. But intermittently.
Aug 1, 2013 at 10:58 AM
I have not seen this issue. Things to try:
  1. Set a breakpoint on the auto-complete method. Is it being called when you hit the first (disappearing) character, and if so, what is it returning?
  2. Have you tried specifing a minimum length e.g. [MinLength(2)] for the auto-complete parameter?
  3. Are you getting this behaviour when you work with the native non-customised Naked Objects MVC UI? (This is a vital step when you experience anything 'odd' in the UI - to rule out the possibility that you are getting a conflict with some custom JavaScript that is consuming the keystroke.
Aug 1, 2013 at 5:25 PM
Thanks Richard.

I was using [MinLength(3)].

I tried step 3 and the issue is also occurring in the non-customised NO MVC UI. It seems to occur when I have multiple autocomplete fields one after the other.
Aug 1, 2013 at 5:31 PM
Ah - OK. I'm not sure I've ever had more than one in one dialog or object - hence haven't seen this. It is very possible that there is an unwanted interaction going on. Because with auto-complete the JS has to 'consume' the Enter key (to avoid accidentally invoking OK or Save when you are just selecting from a drop-down list) - it may be that this is being over-aggressive and somehow consuming the first key on another field. I'll raise a ticket to investigate.
Aug 1, 2013 at 7:00 PM
It seems to occur when I have multiple autocomplete fields one after the other.
I can confirm that where I have seen this behavior, it has also been with multiple auto complete parameters.
Aug 1, 2013 at 7:02 PM
As an aside, it would be nice to have more visual queues on the autocomplete, such as shadow text / water mark that says, "start typing..." and a loader gif on the right to show it is busy fetching data.

Just some thoughts.