1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-13 18:53:59 +02:00

Revert to prev behavior on Android to fix caret (#5470)

* Revert to prev behavior on Android to fix caret

* add changeset
This commit is contained in:
Joseph Rollins
2023-06-28 08:29:43 -07:00
committed by GitHub
parent 511014afa0
commit 4bd15ed395
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
Fix Android caret placement regression when inputting into empty editor

View File

@@ -366,7 +366,7 @@ export const Editable = (props: EditableProps) => {
selection && ReactEditor.toDOMRange(editor, selection) selection && ReactEditor.toDOMRange(editor, selection)
if (newDomRange) { if (newDomRange) {
if (ReactEditor.isComposing(editor)) { if (ReactEditor.isComposing(editor) && !IS_ANDROID) {
domSelection.collapseToEnd() domSelection.collapseToEnd()
} else if (Range.isBackward(selection!)) { } else if (Range.isBackward(selection!)) {
domSelection.setBaseAndExtent( domSelection.setBaseAndExtent(