From 416590e1deb5afe3c3c79f953911e8f08e275eaa Mon Sep 17 00:00:00 2001 From: Kalley Powell Date: Wed, 24 Oct 2018 16:41:06 -0500 Subject: [PATCH] Fix cloneFragment conditional handling of clipboardData.setData (#2298) Seems the issue was introduced here: https://github.com/ianstormtaylor/slate/commit/dc95ad66a522e9d5c1626e65844f160834224696#diff-dfb9fbad6106fa548b8335a644d03e49L109 Remvoing the `return` ended up calling `callback` twice instead of the intended once and both branches being followed --- packages/slate-react/src/utils/clone-fragment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/slate-react/src/utils/clone-fragment.js b/packages/slate-react/src/utils/clone-fragment.js index f77d06d55..ea93c6915 100644 --- a/packages/slate-react/src/utils/clone-fragment.js +++ b/packages/slate-react/src/utils/clone-fragment.js @@ -114,6 +114,7 @@ function cloneFragment(event, editor, callback = () => undefined) { event.clipboardData.setData(FRAGMENT, encoded) event.clipboardData.setData(HTML, div.innerHTML) callback() + return } // COMPAT: For browser that don't support the Clipboard API's setData method,