mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-07 15:56:35 +02:00
Fix editor.insertText never gets called inside plugins on Android (#4753)
* Call Editor.insertText instead of Transforms.insertText to allow overriding by plugins * Use Editor.insertText in android-input-manager * changeset
This commit is contained in:
5
.changeset/breezy-ears-happen.md
Normal file
5
.changeset/breezy-ears-happen.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix "editor.insertText never gets called inside plugins on android"
|
@@ -560,9 +560,7 @@ export const AndroidEditable = (props: EditableProps): JSX.Element => {
|
|||||||
})
|
})
|
||||||
editor.marks = null
|
editor.marks = null
|
||||||
} else {
|
} else {
|
||||||
Transforms.insertText(editor, text, {
|
Editor.insertText(editor, text)
|
||||||
at,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, RESOLVE_DELAY)
|
}, RESOLVE_DELAY)
|
||||||
|
@@ -134,9 +134,7 @@ export class AndroidInputManager {
|
|||||||
})
|
})
|
||||||
this.editor.marks = null
|
this.editor.marks = null
|
||||||
} else {
|
} else {
|
||||||
Transforms.insertText(this.editor, text, {
|
Editor.insertText(this.editor, text)
|
||||||
at,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -793,7 +793,7 @@ export const Editable = (props: EditableProps) => {
|
|||||||
distance: currentTextNode.text.length,
|
distance: currentTextNode.text.length,
|
||||||
reverse: true,
|
reverse: true,
|
||||||
})
|
})
|
||||||
Transforms.insertText(editor, text)
|
Editor.insertText(editor, text)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user