forked from GitHub/gf-core
minibar: don't force focus to the typed input field after every word
On touch-based devices, the on-screen keyboard kept popping up after every word, which was very annoying if you were entering a sentence by tapping on the magnets.
This commit is contained in:
@@ -244,18 +244,16 @@ Minibar.prototype.target_lang=function() {
|
|||||||
|
|
||||||
Minibar.prototype.add_typed_input=function() {
|
Minibar.prototype.add_typed_input=function() {
|
||||||
with(this) {
|
with(this) {
|
||||||
var inp;
|
if(!surface.typed) {
|
||||||
if(surface.typed) inp=surface.typed;
|
var inp=empty("input","type","text");
|
||||||
else {
|
|
||||||
inp=empty("input","type","text");
|
|
||||||
inp.value="";
|
inp.value="";
|
||||||
inp.setAttribute("accesskey","t");
|
inp.setAttribute("accesskey","t");
|
||||||
inp.style.width="10em";
|
inp.style.width="10em";
|
||||||
inp.onkeyup=bind(complete_typed,this);
|
inp.onkeyup=bind(complete_typed,this);
|
||||||
surface.appendChild(inp);
|
surface.appendChild(inp);
|
||||||
surface.typed=inp;
|
surface.typed=inp;
|
||||||
|
inp.focus();
|
||||||
}
|
}
|
||||||
inp.focus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user