1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00
This commit is contained in:
Ian Storm Taylor
2016-06-17 12:14:51 -07:00
parent 88c58debec
commit 63449e9b04

View File

@@ -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)
}