Skip to content

Commit

Permalink
Fix onDragStart callback dependency on 'readonly' (#4707)
Browse files Browse the repository at this point in the history
* fix: add 'readonly' dependency for onDragStart callback

* add changeset
  • Loading branch information
ahoisl authored Dec 4, 2021
1 parent 6d19407 commit c020ca2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hungry-dingos-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

fix: add 'readonly' dependency for onDragStart callback
2 changes: 1 addition & 1 deletion packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ export const Editable = (props: EditableProps) => {
ReactEditor.setFragmentData(editor, event.dataTransfer)
}
},
[attributes.onDragStart]
[readOnly, attributes.onDragStart]
)}
onDrop={useCallback(
(event: React.DragEvent<HTMLDivElement>) => {
Expand Down

0 comments on commit c020ca2

Please sign in to comment.