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

Why content added from start ? #67

Open
surohak opened this issue Mar 16, 2021 · 2 comments
Open

Why content added from start ? #67

surohak opened this issue Mar 16, 2021 · 2 comments

Comments

@surohak
Copy link

surohak commented Mar 16, 2021

Hi, can you take a look at this example?
https://codesandbox.io/s/tender-dew-fwwcf?file=/src/App.js

Here all values added from start.

I think it's from the wrong position of cursor after input anything.

@jaywcjlove
Copy link
Member

@surohak https://codesandbox.io/s/react-markdown-editor-ybpce?file=/src/App.js

Can't use state control, I need to look into it.

import MarkdownEditor from "@uiw/react-markdown-editor";
import { useState } from "react";
import "./styles.css";

export default function App() {
  const [markdownVal, setMarkdownVal] = useState("");
  console.log("markdownVal:", markdownVal);
  return (
    <div className="App">
      <MarkdownEditor
        value="# title"
        onChange={(editor, data, value) => {
          setMarkdownVal(value);
        }}
      />
    </div>
  );
}

@surohak
Copy link
Author

surohak commented Mar 17, 2021

ok, I think it's will be good with state control.

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