2
Draft.jsのRichUtils.toggleInlineStyleが正しく機能しません。助けてください! 私のコードはJSfiddleです。Draft.jsのRichUtils.toggleInlineStyleが機能しない
誤解はありますか?
var TextArea = React.createClass({
...
toggleBlockStyle: function(blockType) {
this.onChange(RichUtils.toggleBlockType(this.state.editorState, blockType)); // don't work!
},
toggleInlineStyle: function(inlineStyle) {
this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, inlineStyle)); // don't work!
},
handleClear: function() {
this.onChange(EditorState.push(this.state.editorState,
ContentState.createFromText(''), 'remove-range')); // don't work!
},
...
render: function() {
return (
<div onClick={this.onFocus}>
{this.renderButtons()}
<Editor editorState={this.state.editorState}
className={this.props.className}
name={this.props.name} ref="editor"
placeholder={this.props.placeholder}
handleKeyCommand={this.handleKeyCommand}
onChange={this.onChange}
spellCheck={true}
stripPastedStyles={true}
customStyleMap={myStyleMap}/>
</div>);
}
}