mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 09:43:58 +02:00
* fixed cursor when we triple click on text and type over it * fixed * fixed * Add changeset Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
5
.changeset/healthy-wasps-sit.md
Normal file
5
.changeset/healthy-wasps-sit.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-react: patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fixed cursor when triple clicking on text and type over it, fixes #4862
|
@@ -483,6 +483,13 @@ export const Editable = (props: EditableProps) => {
|
|||||||
case 'insertFromYank':
|
case 'insertFromYank':
|
||||||
case 'insertReplacementText':
|
case 'insertReplacementText':
|
||||||
case 'insertText': {
|
case 'insertText': {
|
||||||
|
const { selection } = editor
|
||||||
|
if (selection) {
|
||||||
|
if (Range.isExpanded(selection)) {
|
||||||
|
Editor.deleteFragment(editor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (type === 'insertFromComposition') {
|
if (type === 'insertFromComposition') {
|
||||||
// COMPAT: in Safari, `compositionend` is dispatched after the
|
// COMPAT: in Safari, `compositionend` is dispatched after the
|
||||||
// `beforeinput` for "insertFromComposition". But if we wait for it
|
// `beforeinput` for "insertFromComposition". But if we wait for it
|
||||||
|
Reference in New Issue
Block a user