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

Create and edit element using markdown #395

Open
StasSpawn opened this issue May 26, 2022 · 5 comments
Open

Create and edit element using markdown #395

StasSpawn opened this issue May 26, 2022 · 5 comments

Comments

@StasSpawn
Copy link

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)
@jaywcjlove
Copy link
Member

@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}
/>

@StasSpawn
Copy link
Author

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

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

@jaywcjlove
Copy link
Member

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

@StasSpawn

@StasSpawn
Copy link
Author

StasSpawn commented May 27, 2022

@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
Copy link
Author

@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.

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