1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-18 22:08:18 +01:00

change isnative flag name

This commit is contained in:
Ian Storm Taylor 2016-06-18 23:07:55 -07:00
parent ba483d6e7b
commit d9b4e58029
3 changed files with 6 additions and 6 deletions

View File

@ -36,7 +36,7 @@ class Content extends React.Component {
shouldComponentUpdate(props, state) {
if (props.state == this.props.state) return false
if (props.state.document == this.props.state.document) return false
if (props.state.rerender == false) return false
if (props.state.isNative) return false
return true
}
@ -132,7 +132,7 @@ class Content extends React.Component {
state = state
.transform()
.insertText(data)
.apply({ rerender: false })
.apply({ isNative: true })
}
this.onChange(state)

View File

@ -21,7 +21,7 @@ const DEFAULT_PROPERTIES = {
document: new Document(),
selection: new Selection(),
history: new History(),
rerender: true
isNative: true
}
/**

View File

@ -70,7 +70,7 @@ class Transform extends Record(DEFAULT_PROPERTIES) {
* Apply the transform and return the new state.
*
* @param {Object} options
* @property {Boolean} rerender
* @property {Boolean} isNative
* @return {State} state
*/
@ -121,10 +121,10 @@ class Transform extends Record(DEFAULT_PROPERTIES) {
return state[type](...args)
}, state)
// Apply the "rerender" flag, which is used to allow for natively-handled
// Apply the "isNative" flag, which is used to allow for natively-handled
// content changes to skip rerendering the editor for performance.
state = state.merge({
rerender: options.rerender === false ? false : true
isNative: !! options.isNative
})
return state