uiwjs / react-md-editor

A simple markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-md-editor
MIT License
2.03k stars 149 forks source link

How can i set textarea(.w-md-editor-text-input)'s parent <div> height style? #625

Open imkdw opened 3 months ago

imkdw commented 3 months ago
import t\MDEditor from '@uiw/react-md-editor';

interface Props {
  content: string;
  changeHandler: (content: string) => void;
}

export default function ArticleContentEditor({ content, changeHandler }: Props) {
  const changeContentHandler = (value: string | undefined) => {
    if (value) {
      changeHandler(value);
    }
  };

  return (
    <MDEditor
      value={content}
      height="500px"
      onChange={(changedContent) => changeContentHandler(changedContent)}
      highlightEnable={false}
    />
  );
}

This is my code, when i set height="500px" on MDEditor Component But not working on textarea, textarea is so small

image image

Need to set more properties of MDEditor?

jaywcjlove commented 3 months ago

@imkdw I can't reproduce your issue. Can you provide an example to help me investigate?

imkdw commented 3 months ago

@jaywcjlove

Thank you for your response But I can't find what's wrong.. so I set css height: 100% on class of w-md-editor-text It doesn't feel right, but it's resolved, so I think I should use it like this

.w-md-editor-text {
  height: 100%;
}

image

jongyoul commented 2 months ago

I have the same issue exactly.

image
jongyoul commented 2 months ago

It looks related to https://github.com/uiwjs/react-md-editor/commit/a7d9a2c266200579e083f70b63effafd08c328d3