mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-01 13:00:16 +02:00
change isnative flag name
This commit is contained in:
@@ -36,7 +36,7 @@ class Content extends React.Component {
|
|||||||
shouldComponentUpdate(props, state) {
|
shouldComponentUpdate(props, state) {
|
||||||
if (props.state == this.props.state) return false
|
if (props.state == this.props.state) return false
|
||||||
if (props.state.document == this.props.state.document) 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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ class Content extends React.Component {
|
|||||||
state = state
|
state = state
|
||||||
.transform()
|
.transform()
|
||||||
.insertText(data)
|
.insertText(data)
|
||||||
.apply({ rerender: false })
|
.apply({ isNative: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onChange(state)
|
this.onChange(state)
|
||||||
|
@@ -21,7 +21,7 @@ const DEFAULT_PROPERTIES = {
|
|||||||
document: new Document(),
|
document: new Document(),
|
||||||
selection: new Selection(),
|
selection: new Selection(),
|
||||||
history: new History(),
|
history: new History(),
|
||||||
rerender: true
|
isNative: true
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -70,7 +70,7 @@ class Transform extends Record(DEFAULT_PROPERTIES) {
|
|||||||
* Apply the transform and return the new state.
|
* Apply the transform and return the new state.
|
||||||
*
|
*
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
* @property {Boolean} rerender
|
* @property {Boolean} isNative
|
||||||
* @return {State} state
|
* @return {State} state
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -121,10 +121,10 @@ class Transform extends Record(DEFAULT_PROPERTIES) {
|
|||||||
return state[type](...args)
|
return state[type](...args)
|
||||||
}, state)
|
}, 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.
|
// content changes to skip rerendering the editor for performance.
|
||||||
state = state.merge({
|
state = state.merge({
|
||||||
rerender: options.rerender === false ? false : true
|
isNative: !! options.isNative
|
||||||
})
|
})
|
||||||
|
|
||||||
return state
|
return state
|
||||||
|
Reference in New Issue
Block a user