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

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

Open
imkdw opened this issue Mar 20, 2024 · 5 comments
Open

Comments

@imkdw
Copy link

imkdw commented Mar 20, 2024

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?

@imkdw imkdw closed this as completed Mar 20, 2024
@imkdw imkdw reopened this Mar 20, 2024
@jaywcjlove
Copy link
Member

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

@imkdw
Copy link
Author

imkdw commented Mar 23, 2024

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

jongyoul commented May 3, 2024

I have the same issue exactly.

image

@jongyoul
Copy link

jongyoul commented May 3, 2024

It looks related to a7d9a2c

@jazztester
Copy link

Hi found a temp fix referencing comments form @imkdw and @jongyoul, we can use:
.w-md-editor-text { min-height: 100% !important; }

you can try height: 100% as well but for me it breaks cursor placement

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

4 participants