1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-01 03:11: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, Editable,
withReact, withReact,
useEditor, useEditor,
ReactEditor,
useFocused, useFocused,
useSelected, useSelected,
} from 'slate-react' } from 'slate-react'
@@ -91,7 +92,7 @@ const VideoElement = ({ attributes, children, element }) => {
boxSizing: 'border-box', boxSizing: 'border-box',
}} }}
onChange={value => { onChange={value => {
const path = editor.findPath(element) const path = ReactEditor.findPath(editor, element)
Transforms.setNodes(editor, { url: value }, { at: path }) Transforms.setNodes(editor, { url: value }, { at: path })
}} }}
/> />