-
Notifications
You must be signed in to change notification settings - Fork 103
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
The change in value prop does not change the text displayed in editor #64
Comments
Hm. This is interesting. Can you fill the reproducible example using https://codesandbox.io/? |
I got it reproduced. And it's very weird indeed. Needs to be fixed. Feel free to try to fix it, maybe someday will have time to dig into it. @iaaflaafc |
I played with demo. I am able to reproduce the issue with simpler code. import * as React from 'react';
import * as SimpleMDEReact from 'react-simplemde-editor';
import 'react-simplemde-editor/demo/dist/stylesheets/vendor.css';
export default class Demo extends React.Component {
public render() {
return (
<SimpleMDEReact
onChange={() => console.log('Not doing anything')}
value="Initial value"
/>
);
}
} It seems that the If we change the Basically, in demo file ( <SimpleMDEReact
label="Markdown Editor"
value={this.state.textValue1}
onChange={this.handleChange1}
/> to <SimpleMDEReact
label="Markdown Editor"
value={"I am the initial value. Erase me, or try the button above."}
onChange={() => console.log('Not doing anything')}
/> It will continue to work as it does now. |
@iaaflaafc any idea how to fix that? |
@iaaflaafc I think I found an issue, should be more controlled now. I will let you know once new version will be deployed. |
@iaaflaafc New version 3.6.16 released. Should solve your issue. |
Hi @RIP21, we are using 5.2.0, having the same issues as this ticket, did it break again and any plans of fixing it? |
@alexarcombe Please provide a reproduction or it's never happened :) |
Thanks for the response @RIP21, I'll try to provide everything you need. I created a small codepen project, first time I use codepen so hopefully you can just follow the link and the app should start. https://codepen.io/alexarcombe/pen/xxJYdVz (Tried to make it easy for you) The start value is "Start" and also on the change I limit the characters to 10. If you click on start and start typing you can see that it doesn't limit it and you can continue to write. If you open the console you can see that the value will be limited, but it is not reflected in the editor. Hopefully this was clear enough, please tell me if you need anything else provided. Cheers, |
I am probably missing something simple but I have a question regarding the
value
prop.Below is the code that illustrates my problem.
The
handleEditorChange
is called whenever user types anything.In this method, I am currently setting
value
to something gibberish.I am passing this value to the
SimpleMDEReact
component.Expectation-
The
SimpleMDEReact
component should show only thevalue
prop passed.Observation-
The
SimpleMDEReact
component does not show what is passed in thevalue
prop. Instead, it shows what the user types.The text was updated successfully, but these errors were encountered: