Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tough-kings-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

fix android soft keyboard dismisses when mark and input
Original file line number Diff line number Diff line change
Expand Up @@ -698,15 +698,13 @@ export function createAndroidInputManager({
offset: start.offset + text.length,
}

scheduleAction(
() => {
Transforms.select(editor, {
anchor: newPoint,
focus: newPoint,
})
},
{ at: newPoint }
)
// `Editor.insertText` with `editor.marks` uses `insertNodes` (new text leaf) instead of
// extending the current leaf, so `newPoint` can be past the end of `start.path`.
// `performAction` already applies `normalizePoint` to `action.at` before `run()`;
// a second `Transforms.select` here with the raw point would overwrite that and leave
// an invalid selection (e.g. Android keyboard dismiss). Selection is set in
// `performAction` only.
scheduleAction(() => {}, { at: newPoint })
}
return
}
Expand Down