From b864026f95d610a1b6631c9047fc7d9b099773cd Mon Sep 17 00:00:00 2001 From: Alex Hoisl <32290337+ahoisl@users.noreply.github.com> Date: Thu, 2 Dec 2021 14:34:22 +0100 Subject: [PATCH 1/2] fix: add 'readonly' dependency for onDragStart callback --- packages/slate-react/src/components/editable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) => { From 72c2dbcf7b871050b5d7c63b2a3fc3b58220672d Mon Sep 17 00:00:00 2001 From: Alex Hoisl <32290337+ahoisl@users.noreply.github.com> Date: Thu, 2 Dec 2021 14:40:03 +0100 Subject: [PATCH 2/2] add changeset --- .changeset/hungry-dingos-do.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hungry-dingos-do.md 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