Skip to content

Commit ec6b1ff

Browse files
ahornaceVladimir Kotal
authored andcommitted
Do not replace input value on mouse focus
1 parent 1dd0d9c commit ec6b1ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

web/js/utils-0.0.23.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ function initAutocompleteForField(inputId, field, config, dataFunction, errorEle
18381838
$("<li>", {
18391839
class: "ui-state-disabled",
18401840
style: 'padding-left: 5px;',
1841-
text: time + 'ms'
1841+
text: time + ' ms'
18421842
}).appendTo(ul);
18431843
}
18441844
if (partialResult) {
@@ -1855,7 +1855,9 @@ function initAutocompleteForField(inputId, field, config, dataFunction, errorEle
18551855
event.preventDefault();
18561856
return;
18571857
}
1858-
replaceValueWithSuggestion(input, text, identifier, ui.item.phrase);
1858+
if (event.originalEvent.originalEvent.type.startsWith('key')) { // replace value only on key events
1859+
replaceValueWithSuggestion(input, text, identifier, ui.item.phrase);
1860+
}
18591861

18601862
event.preventDefault(); // to prevent the movement of the caret to the end
18611863
},

0 commit comments

Comments
 (0)