Skip to content

Commit

Permalink
Revert to prev behavior on Android to fix caret (#5470)
Browse files Browse the repository at this point in the history
* Revert to prev behavior on Android to fix caret

* add changeset
  • Loading branch information
josephmr authored Jun 28, 2023
1 parent 511014a commit 4bd15ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/ten-dryers-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Fix Android caret placement regression when inputting into empty editor
2 changes: 1 addition & 1 deletion packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export const Editable = (props: EditableProps) => {
selection && ReactEditor.toDOMRange(editor, selection)

if (newDomRange) {
if (ReactEditor.isComposing(editor)) {
if (ReactEditor.isComposing(editor) && !IS_ANDROID) {
domSelection.collapseToEnd()
} else if (Range.isBackward(selection!)) {
domSelection.setBaseAndExtent(
Expand Down

0 comments on commit 4bd15ed

Please sign in to comment.