mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 01:33:58 +02:00
cleanup
This commit is contained in:
@@ -99,14 +99,10 @@ class Content extends React.Component {
|
|||||||
onBeforeInput(e) {
|
onBeforeInput(e) {
|
||||||
let { state } = this.props
|
let { state } = this.props
|
||||||
const { data } = e
|
const { data } = e
|
||||||
|
|
||||||
// If there is no data to input, there's nothing to do.
|
|
||||||
if (!data) return
|
if (!data) return
|
||||||
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
// If the state is expanded, we will have to re-render.
|
|
||||||
if (state.isExpanded) state = state.delete()
|
if (state.isExpanded) state = state.delete()
|
||||||
|
|
||||||
state = state.insert(data)
|
state = state.insert(data)
|
||||||
this.onChange(state)
|
this.onChange(state)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user