1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-24 07:52:50 +02:00

Fix Edge pasting exception (#1286)

This commit is contained in:
Kelly Joseph Price
2017-10-25 14:30:33 -07:00
committed by Ian Storm Taylor
parent 3f25e6a902
commit b558872b56

View File

@@ -158,7 +158,10 @@ function getType(transfer, type) {
return type == TEXT ? transfer.getData('Text') || null : null
}
return transfer.types.indexOf(type) !== -1 ? transfer.getData(type) || null : null
// COMPAT: In Edge, transfer.types doesn't respond to `indexOf`. (2017/10/25)
const types = Array.from(transfer.types)
return types.indexOf(type) !== -1 ? transfer.getData(type) || null : null
}
/**