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

Fixed incorrect editor usage in Embed example (#3397)

This commit is contained in:
Josh McFarlin
2020-02-20 20:28:11 -05:00
committed by GitHub
parent e9bad8c5f4
commit 9137a1663f

View File

@@ -5,6 +5,7 @@ import {
Editable,
withReact,
useEditor,
ReactEditor,
useFocused,
useSelected,
} from 'slate-react'
@@ -91,7 +92,7 @@ const VideoElement = ({ attributes, children, element }) => {
boxSizing: 'border-box',
}}
onChange={value => {
const path = editor.findPath(element)
const path = ReactEditor.findPath(editor, element)
Transforms.setNodes(editor, { url: value }, { at: path })
}}
/>