react-native-typerich 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -211,7 +211,12 @@ class TypeRichTextInputView : AppCompatEditText {
211
211
 
212
212
  // text
213
213
  val text = item.coerceToText(context).toString()
214
- this.append(text)
214
+ val editable = editableText
215
+ val start = selectionStart.coerceAtLeast(0)
216
+ val end = selectionEnd.coerceAtLeast(0)
217
+
218
+ editable.replace(minOf(start, end), maxOf(start, end), text)
219
+
215
220
  return true
216
221
  }
217
222
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-typerich",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Textinput replacement",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",