diff --git a/xpfe/components/autocomplete/resources/content/autocomplete.xml b/xpfe/components/autocomplete/resources/content/autocomplete.xml index 686a6a75115f..833fd3ec0ffe 100644 --- a/xpfe/components/autocomplete/resources/content/autocomplete.xml +++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml @@ -355,8 +355,13 @@ break; default: - me.needToAutocomplete = true; - me.autoCompleteTimer = setTimeout(me.privatefunc.callListener, me.timeout, me, 'startLookup'); + /*We want to autocomplete only if the user is editing at the end of the text*/ + var inputElement = document.getAnonymousNodes(me)[0].firstChild; + if (inputElement.selectionEnd >= inputElement.value.length) + { + me.needToAutocomplete = true; + me.autoCompleteTimer = setTimeout(me.privatefunc.callListener, me.timeout, me, 'startLookup'); + } } },