mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.75k stars 139 forks source link

Height Setting clickable area is only first line #527

Closed mweel1 closed 2 months ago

mweel1 commented 2 months ago

If I set a height on the class, the entire control is not clickable to start editing, only the 1st line is.

petyosi commented 2 months ago

Which prop are you setting? There are two props for class names.

mweel1 commented 2 months ago

Thanks for the response...

      className={`h-[200px] border rounded min-h-full ${
        theme == "dark" ? "dark-theme dark-editor" : ""
      }`}
      autoFocus={true}
      toolbar={{
        headings: true,
        lists: true,
        quote: true,
        thematicBreak: true,
        markdownShortcut: true,
      }}
      plugins={[
        toolbarPlugin({
          toolbarContents: () => (
            <>
              <UndoRedo />
              <BoldItalicUnderlineToggles />
            </>
          ),
        }),

        headingsPlugin(),
        listsPlugin(),
        quotePlugin(),
        thematicBreakPlugin(),
        markdownShortcutPlugin(),
      ]}
      {...props}
      ref={editorRef}
    />
mweel1 commented 2 months ago

@petyosi I noticed you closed this ticket, is this fixed somehow?

petyosi commented 2 months ago

You should use the contentEditableClassName prop to specify the height of the content area - it will catch the clicks and focus the component.