securingsincity/react-ace

redo() does not call onChange callback

Open

#292 aberto em 17 de out. de 2017

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (615 forks)batch import
good first issuehelp wanted

Métricas do repositório

Stars
 (3.859 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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.

Guia do colaborador