Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onChange #170

Open
bamaarintoko opened this issue Jul 3, 2019 · 3 comments
Open

onChange #170

bamaarintoko opened this issue Jul 3, 2019 · 3 comments

Comments

@bamaarintoko
Copy link

how to detect onValueChanged?

@JMackR
Copy link

JMackR commented Jul 3, 2019

Check this link #1

@bamaarintoko
Copy link
Author

@jimreynolds67 that not work bro, i have tried

@JMackR
Copy link

JMackR commented Jul 4, 2019

Here's what worked for me... if I understands what your looking for
Im using it to listen for a character '@' in order to trigger a mentions function.

onEditorInitialized = () => {
this.setFocusHandlers();
this.getHTML();
};

async getHTML() {
this.richtext.registerContentChangeListener(str => {
this.setState({ commentText: str })
this.onChangeText(str);
});
}

render() {
...
<RichTextEditor
ref={r => (this.richtext = r)}
style={{
alignItems: "center",
justifyContent: "center",
backgroundColor: "transparent",
width: (width / 100) * 80,
height: (height / 100) * 24,
}}
contentPlaceholder="+ Add a Comment"
hiddenTitle={true}
enableOnChange={true}
initialContentHTML=""
editorInitializedCallback={() => this.onEditorInitialized()}
/>
...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants