Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Fix disappearing numbers with some keyboards
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinesp committed Nov 20, 2023
1 parent 091b29e commit 8e9bbb5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.view.inputmethod.*
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.annotation.VisibleForTesting
import androidx.core.text.isDigitsOnly
import io.element.android.wysiwyg.internal.utils.TextRangeHelper
import io.element.android.wysiwyg.internal.viewmodel.EditorInputAction
import io.element.android.wysiwyg.internal.viewmodel.ReplaceTextResult
Expand Down Expand Up @@ -322,7 +323,11 @@ internal class InterceptInputConnection(
beginBatchEdit()
editable.removeFormattingSpans()
editable.replace(0, editable.length, charSequence)
setComposingRegion(compositionStart, compositionEnd)
val start = compositionStart.coerceIn(0, editable.length)
val end = compositionEnd.coerceIn(0, editable.length)
if (!editable.substring(start, end).isDigitsOnly()) {
setComposingRegion(start, end)
}
endBatchEdit()
}

Expand Down

0 comments on commit 8e9bbb5

Please sign in to comment.