mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 20:51:20 +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) => {
|
||||
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()
|
||||
|
||||
|
Reference in New Issue
Block a user