1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-13 11:44:55 +01: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
}
/**