mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-29 11:18:25 +01:00
Fix the cursor jump to an unexpected position after deleting in android (#5251)
* Fix the cursor jump to an unexpected position after deleting in android * Create unlucky-chairs-promise.md * Update unlucky-chairs-promise.md
This commit is contained in:
parent
f2607c2a52
commit
6fa4b954a5
6
.changeset/unlucky-chairs-promise.md
Normal file
6
.changeset/unlucky-chairs-promise.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
'slate': patch
|
||||
---
|
||||
|
||||
Fix the cursor jump to an unexpected position after deleting in android
|
@ -392,6 +392,11 @@ export function createAndroidInputManager({
|
||||
if (Range.isExpanded(targetRange) && type.startsWith('delete')) {
|
||||
if (Path.equals(targetRange.anchor.path, targetRange.focus.path)) {
|
||||
const [start, end] = Range.edges(targetRange)
|
||||
|
||||
const point = { path: targetRange.anchor.path, offset: start.offset }
|
||||
const range = Editor.range(editor, point, point)
|
||||
handleUserSelect(range)
|
||||
|
||||
return storeDiff(targetRange.anchor.path, {
|
||||
text: '',
|
||||
end: end.offset,
|
||||
|
Loading…
x
Reference in New Issue
Block a user