Comments (9)
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,
Arcombe
from react-simplemde-editor.
Hm. This is interesting. Can you fill the reproducible example using https://codesandbox.io/?
from react-simplemde-editor.
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
Also, take a look at the demo in demo folder in this repo. Funny thing that it works, but for some reason don't work for your case and I have no idea what is wrong TBH :)
from react-simplemde-editor.
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 value
prop that we pass is used only for the initial content that is shown.
If we change the value
prop after SimpleMDEReact
is mounted, the content that is shown does not reflect the value
that is passed.
Basically, in demo file (demo.js
), if we change
<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.
from react-simplemde-editor.
@iaaflaafc any idea how to fix that?
Yes, it behaves like a regular input with defaultValue, but in the demo, it's still updating when onChange triggered.
I need to dig into the SimpleMDE docs itself (I'm not the original author of this adoption)
from react-simplemde-editor.
@iaaflaafc I think I found an issue, should be more controlled now. I will let you know once new version will be deployed.
from react-simplemde-editor.
@iaaflaafc New version 3.6.16 released. Should solve your issue.
from react-simplemde-editor.
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?
from react-simplemde-editor.
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 :)
from react-simplemde-editor.
Related Issues (20)
- Cursor jumps to the beginning of the text when two keys are pressed HOT 3
- when dark mode? HOT 2
- Not working internal link in README.md HOT 2
- Custom toolbar button to open a separate React component (or any kind of div input from where I can accept input) HOT 3
- How can I disable markdown AutoComplete feature? HOT 1
- lost focus when using onChange with nextjs HOT 7
- lineNumbers option prevents backspace of empty line on Mobile HOT 2
- TypeError `_react.useMemo` is not a function HOT 3
- how to make this RTL ? HOT 7
- Cursor randomly jumps before first character when typing HOT 1
- can't use options when use getCodemirrorInstance to change state HOT 1
- window is not defined HOT 3
- Preview not working (showing undefined) HOT 5
- You may need an additional loader to handle the result of these loaders. HOT 4
- toolbar does not display on MacOS HOT 2
- Enforce maxLength attribute HOT 3
- Editor fetches assets from external sources HOT 1
- Multiline Code Block Highlighting in Edit Mode HOT 1
- Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? HOT 2
- has fetching error with react query HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-simplemde-editor.