1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

Fix cloneFragment conditional handling of clipboardData.setData (#2298)

Seems the issue was introduced here: dc95ad66a5 (diff-dfb9fbad6106fa548b8335a644d03e49L109)

Remvoing the `return` ended  up calling `callback` twice instead of the intended once and both branches being followed
This commit is contained in:
Kalley Powell
2018-10-24 16:41:06 -05:00
committed by Ian Storm Taylor
parent 1032d14ffb
commit 416590e1de

View File

@@ -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,