mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-01 03:11:44 +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:
committed by
Ian Storm Taylor
parent
7cbf15e3cc
commit
4cb13ee5ca
@@ -48,11 +48,16 @@ function SlateReactPlaceholder(options = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const others = next()
|
const others = next()
|
||||||
|
const document = editor.value.document
|
||||||
const first = node.getFirstText()
|
const first = node.getFirstText()
|
||||||
const last = node.getLastText()
|
const last = node.getLastText()
|
||||||
const decoration = {
|
const decoration = {
|
||||||
anchor: { key: first.key, offset: 0 },
|
anchor: { key: first.key, offset: 0, path: document.getPath(first.key) },
|
||||||
focus: { key: last.key, offset: last.text.length },
|
focus: {
|
||||||
|
key: last.key,
|
||||||
|
offset: last.text.length,
|
||||||
|
path: document.getPath(last.key),
|
||||||
|
},
|
||||||
mark: placeholderMark,
|
mark: placeholderMark,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user