mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 10:14:02 +02:00
fix: selection out of sync in readonly mode (#5120)
This commit is contained in:
@@ -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]
|
||||
|
Reference in New Issue
Block a user