1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 03:32:36 +02:00

Fix crash on Input Tester example with certain input events

If an Input event with inputType  "insertReplacementText" is received, the example crashes because "event.dataTransfer.get is not a function"
The correct API is `getData()`, not `get()`.
Ref: https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/getData
This commit is contained in:
Brian Bucknam
2018-10-17 12:26:30 -07:00
parent 82e1213be3
commit 6f2d2e1eb8

View File

@@ -176,7 +176,7 @@ const Event = ({ event, targetRange, selection }) => {
</td>
<td>
<StringCell
value={event.dataTransfer && event.dataTransfer.get('text/plain')}
value={event.dataTransfer && event.dataTransfer.getData('text/plain')}
/>
</td>
<td>