harthur/fileit — pull request #6 by edmorley (2013-06-07 14:14:24+00:00)
Title: Mouseover should not overwrite entered text

In Firefox, if the mouse cursor is immediately below the input field, auto-complete entries will be selected even when the mouse remains still, causing the typed value to be overwritten. (In Chrome the jquery mouseover event isn't fired until the mouse is moved, whereas in Firefox it gets fired as the DOM changes under it).

The auto-complete plugin being used here hasn't been updated in 3 years (https://github.com/nikosd/jquery-autocomplete), otherwise I'd try and fix upstream. Another solution would be to switch to the newer jquery UI auto-complete library, but it depends on such a ridiculous amount of other jquery UI libraries that it doesn't seem worth it.

The solution here preserves the functionality of the up/down arrows, but just ensures mouseover only updates the highlighted row, rather than overwriting the input field too. The mouseup event takes care of changing the input value if not using the keyboard.