do it twice to prevent flicker

This commit is contained in:
Damien Elmes 2012-04-07 18:05:31 +09:00
parent 3828c43cd8
commit 17a80e13c0

View file

@ -97,6 +97,8 @@ function onFocus(elem) {
py.run("focus:" + currentField.id.substring(1));
// don't adjust cursor on mouse clicks
if (mouseDown) { return; }
// do this twice so that there's no flicker on newer versions
caretToEnd();
// need to do this in a timeout for older qt versions
setTimeout(function () { caretToEnd() }, 1);
// scroll if bottom of element off the screen