wix-incubator / react-native-zss-rich-text-editor

React Native rich text editor based on ZSSRichTextEditor
Other
841 stars 310 forks source link

getContentHtml not adding it to state on Android #134

Open udarts opened 6 years ago

udarts commented 6 years ago

I am using the following code to get the html content and add it to the state. Somehow this is working on iOS, but not on android. On Android it returns empty.

This is the code I use:

constructor(props) {

    this.state = {
        bodyText: '',
    }
}
_saveAndToggle(visible) {
    this.getHTML();
    this.setState({ isModalVisible: visible });
};
async getHTML() {
    const contentHtml = await this.richtext.getContentHtml();
    this.setState({
        bodyText: contentHtml
    });
};

The _saveAndToggle is on an onPress of a button.

Any idea why this is not working?

I use version 1.1.0 of react-native-zss-rich-text-editor react-native: 0.56

Cheers, Stephan