react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

Create and edit element using markdown

Open StasSpawn opened this issue 3 years ago • 5 comments

Can i use this component for:

  1. Create elements/comments on page (I need multiple elements, like comment section)
  2. Edit them after they was created (button edit - click - and elements inside this comment return to MarkDown, where user can make some changes)

StasSpawn avatar May 26 '22 08:05 StasSpawn

@StasSpawn Not sure if you need an example like this https://codesandbox.io/s/markdown-editor-for-react-uiwjs-react-md-editor-issues-395-jxcwzq?file=/index.js

image
import MDEditor from "@uiw/react-md-editor";
+ import { commands } from "@uiw/react-md-editor";

+ const commandsObj = [
+   commands.codeEdit,
+   commands.codePreview,
+   commands.divider,
+   commands.fullscreen
+ ];


<MDEditor
+  extraCommands={commandsObj}
+  preview="edit"
  height={200}
  value={value}
  onChange={setValue}
/>

jaywcjlove avatar May 27 '22 01:05 jaywcjlove

@jaywcjlove I need something like this. 2022-05-27_132545

  1. Now i can create comments
  2. But i also want to edit them.

StasSpawn avatar May 27 '22 10:05 StasSpawn

https://codesandbox.io/s/markdown-editor-for-react-uiwjs-react-md-editor-issues-395-jxcwzq?file=/index.js

@StasSpawn

jaywcjlove avatar May 27 '22 14:05 jaywcjlove

@jaywcjlove Thank you so much for answer! I will check your work!

For now i manage to do it myself. But I'm using only 1 MDEditor inside modal window for creating and aditing comments.

StasSpawn avatar May 27 '22 14:05 StasSpawn

@jaywcjlove Hello.

I've return to your examples and realize - they don't have creation functionality. Here we have already created comments and can edit them. But I need to

  1. create multiple comments
  2. and then change each of them.

So, we dont have an initial items with comments, they has to be created and first.

StasSpawn avatar Jul 15 '22 10:07 StasSpawn