mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-17 13:38:37 +01:00
fix: selection out of sync in readonly mode (#5120)
This commit is contained in:
parent
8eb1972b5b
commit
9815bdabdd
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),
|
||||
[readOnly]
|
||||
|
Loading…
x
Reference in New Issue
Block a user