diff --git a/examples/large-document/index.js b/examples/large-document/index.js index d9719e9e4..4a606fae4 100644 --- a/examples/large-document/index.js +++ b/examples/large-document/index.js @@ -80,7 +80,7 @@ class LargeDocument extends React.Component { diff --git a/src/components/content.js b/src/components/content.js index 35817547d..1ab67dea1 100644 --- a/src/components/content.js +++ b/src/components/content.js @@ -35,6 +35,7 @@ class Content extends React.Component { */ static propTypes = { + autoCorrect: React.PropTypes.bool.isRequired, className: React.PropTypes.string, editor: React.PropTypes.object.isRequired, onBeforeInput: React.PropTypes.func.isRequired, @@ -98,6 +99,7 @@ class Content extends React.Component { return ( props.className != this.props.className || props.schema != this.props.schema || + props.autoCorrect != this.props.autoCorrect || props.spellCheck != this.props.spellCheck || props.state != this.props.state || props.style != this.props.style @@ -747,6 +749,7 @@ class Content extends React.Component { onKeyUp={this.onKeyUp} onPaste={this.onPaste} onSelect={this.onSelect} + autoCorrect={props.autoCorrect} spellCheck={spellCheck} style={style} role={readOnly ? null : (role || 'textbox')} diff --git a/src/components/editor.js b/src/components/editor.js index e464c837e..2867f59a3 100644 --- a/src/components/editor.js +++ b/src/components/editor.js @@ -61,6 +61,7 @@ class Editor extends React.Component { */ static propTypes = { + autoCorrect: React.PropTypes.bool, className: React.PropTypes.string, onBeforeChange: React.PropTypes.func, onChange: React.PropTypes.func, @@ -86,6 +87,7 @@ class Editor extends React.Component { */ static defaultProps = { + autoCorrect: true, onChange: noop, onDocumentChange: noop, onSelectionChange: noop, @@ -253,6 +255,7 @@ class Editor extends React.Component { state={this.getState()} className={props.className} readOnly={props.readOnly} + autoCorrect={props.autoCorrect} spellCheck={props.spellCheck} style={props.style} tabIndex={props.tabIndex} diff --git a/src/models/node.js b/src/models/node.js index 2b4e66e35..a082443fe 100644 --- a/src/models/node.js +++ b/src/models/node.js @@ -260,6 +260,7 @@ const Node = { return this .getTexts() .map(text => this.getClosestBlock(text.key)) + // Eliminate duplicates .toOrderedSet() .toList() }, @@ -275,6 +276,9 @@ const Node = { return this .getTextsAtRange(range) .map(text => this.getClosestBlock(text.key)) + // Eliminate duplicates + .toOrderedSet() + .toList() }, /** diff --git a/test/rendering/index.js b/test/rendering/index.js index fe2998803..550307ea3 100644 --- a/test/rendering/index.js +++ b/test/rendering/index.js @@ -56,6 +56,7 @@ function clean(html) { $(el).removeAttr('data-offset-key') }) + $.root().children().removeAttr('autocorrect') $.root().children().removeAttr('spellcheck') $.root().children().removeAttr('style')