1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 12:14:14 +02:00

fix <Void> to always get latest state onClick, closes #223

This commit is contained in:
Ian Storm Taylor
2016-08-05 10:37:56 -07:00
parent 772aadb70a
commit 3dc930a859

View File

@@ -42,10 +42,11 @@ class Void extends React.Component {
onClick = (e) => {
e.preventDefault()
const { state, node, editor } = this.props
const next = state
const { node, editor } = this.props
const next = editor
.getState()
.transform()
.moveToRangeOf(node)
.collapseToStartOf(node)
.focus()
.apply()