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