diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index edca99830505107b264a6583be926879aa625015..3ecf5f0fb5692a1169c2daceb41f0b8c7b16bace 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -1839,9 +1839,8 @@ public final class InputLogic {
                 // the segment of text starting at the supplied index and running for the length
                 // of the auto-correction flash. At this moment, the "typedWord" argument is
                 // ignored by TextView.
-                mConnection.commitCorrection(
-                        new CorrectionInfo(
-                        mConnection.getExpectedSelectionEnd() - typedWord.length(),
+                mConnection.commitCorrection(new CorrectionInfo(
+                        mConnection.getExpectedSelectionEnd() - autoCorrection.length(),
                         typedWord, autoCorrection));
             }
         }