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:
@@ -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 })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user