1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +02:00

Fix crash on drag and drop image on readOnly editable (#4617)

* Fix crash on drag and drop image on readOnly editable

* add changeset
This commit is contained in:
I Made Budi Surya Darma 2021-10-22 21:39:30 +08:00 committed by GitHub
parent 67badb7dd0
commit b186d3ea12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
'slate-react': patch
---
Fix crash on drag and drop image on readOnly editable

View File

@ -884,6 +884,7 @@ export const Editable = (props: EditableProps) => {
onDragStart={useCallback(
(event: React.DragEvent<HTMLDivElement>) => {
if (
!readOnly &&
hasTarget(editor, event.target) &&
!isEventHandled(event, attributes.onDragStart)
) {