fix wrong caret position after inject_text() in chrome