diff --git a/.changeset/hungry-dingos-do.md b/.changeset/hungry-dingos-do.md new file mode 100644 index 0000000000..8974336b04 --- /dev/null +++ b/.changeset/hungry-dingos-do.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +fix: add 'readonly' dependency for onDragStart callback diff --git a/packages/slate-react/src/components/editable.tsx b/packages/slate-react/src/components/editable.tsx index ac99add80f..22024bd76b 100644 --- a/packages/slate-react/src/components/editable.tsx +++ b/packages/slate-react/src/components/editable.tsx @@ -936,7 +936,7 @@ export const Editable = (props: EditableProps) => { ReactEditor.setFragmentData(editor, event.dataTransfer) } }, - [attributes.onDragStart] + [readOnly, attributes.onDragStart] )} onDrop={useCallback( (event: React.DragEvent) => {