securingsincity/react-ace

redo() does not call onChange callback

Open

#292 创建于 2017年10月17日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)JavaScript (3,859 star) (615 fork)batch import
good first issuehelp wanted

描述

I have onChange callback and setting the value from state as below:

class MyComponent extends React.Component {
    constructor(props, context) {
        super(props, context);
        this.state = {content: "Hello"}
    }
    onContentChange(value) {
        this.setState({content: value})
    }
    render() {
        <AceEditor
            ref={instance => { this.aceEditor = instance; }}
            mode="java"
            theme="github"
            onChange={this.onContentChange}
            name="UNIQUE_ID_OF_DIV"
            editorProps={{$blockScrolling: true}}
        />
    }
}

When I call this.aceEditor.editor.undo() then onContentChange gets called but when I do this.aceEditor.editor.redo() then onContentChange does not get called.

贡献者指南