mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 01:33:58 +02:00
fix: selection out of sync in readonly mode (#5120)
This commit is contained in:
5
.changeset/calm-readers-brake.md
Normal file
5
.changeset/calm-readers-brake.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix editor selection out of sync in readonly mode
|
@@ -231,6 +231,11 @@ export const Editable = (props: EditableProps) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deselect the editor if the dom selection is not selectable in readonly mode
|
||||||
|
if (readOnly && (!anchorNodeSelectable || !focusNodeSelectable)) {
|
||||||
|
Transforms.deselect(editor)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 100),
|
}, 100),
|
||||||
[readOnly]
|
[readOnly]
|
||||||
|
Reference in New Issue
Block a user