mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 12:41:44 +02:00
fix <Void> to always get latest state onClick, closes #223
This commit is contained in:
@@ -42,10 +42,11 @@ class Void extends React.Component {
|
|||||||
|
|
||||||
onClick = (e) => {
|
onClick = (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const { state, node, editor } = this.props
|
const { node, editor } = this.props
|
||||||
const next = state
|
const next = editor
|
||||||
|
.getState()
|
||||||
.transform()
|
.transform()
|
||||||
.moveToRangeOf(node)
|
.collapseToStartOf(node)
|
||||||
.focus()
|
.focus()
|
||||||
.apply()
|
.apply()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user