1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 19:01:54 +02:00

Add path to Range Points (#2537)

* Add path to Range Points

Otherwise 5d0f53da3f/packages/slate-react/src/components/text.js (L122) crashes

* Make prettier happy

* prettier knows what prettier knows

So shut up and delete the fucking whitespace ;)
This commit is contained in:
Velten Heyn
2019-04-25 02:16:41 +02:00
committed by Ian Storm Taylor
parent 7cbf15e3cc
commit 4cb13ee5ca

View File

@@ -48,11 +48,16 @@ function SlateReactPlaceholder(options = {}) {
}
const others = next()
const document = editor.value.document
const first = node.getFirstText()
const last = node.getLastText()
const decoration = {
anchor: { key: first.key, offset: 0 },
focus: { key: last.key, offset: last.text.length },
anchor: { key: first.key, offset: 0, path: document.getPath(first.key) },
focus: {
key: last.key,
offset: last.text.length,
path: document.getPath(last.key),
},
mark: placeholderMark,
}