1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-26 00:27:28 +02:00

fix(Safari): Set a text value in dataTransfer to have the cursor on Safari when dragging a text node (#1927)

This commit is contained in:
Quentin Gérôme
2018-06-22 17:52:02 +02:00
committed by Ian Storm Taylor
parent d8d0b5ff3c
commit ec51444df1

View File

@@ -34,6 +34,9 @@ function setEventTransfer(event, type, content) {
try {
transfer.setData(mime, content)
// COMPAT: Safari needs to have the 'text' (and not 'text/plain') value in dataTransfer
// to display the cursor while dragging internally.
transfer.setData('text', transfer.getData('text'))
} catch (err) {
const prefix = 'SLATE-DATA-EMBED::'
const text = transfer.getData(TEXT)