Tencent / Tencent/cherry-markdown

[Bug report]Antd's UI `Form` component failed to automatically obtain values

Open
#508 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
4.9k
Forks
572
Avg merge
17h 5m
Merged PRs (30d)
14

Description

Describe the bug

When using the Form component of Antd, after filling in the name, the field still obtains an undefined

To Reproduce
Steps to reproduce the behavior:

                <Form.Item name='content'
                        rules={[
                            { min: 5, message: '文章最最少5个字符' },
                            { max: 20000, message: '文章最多20000个字符' },
                        ]}
                    >
                         {/* <Input style={{ width: '100%' }} placeholder="请输入标题" /> */}
                        <div className='cherry-markdown' id='cherry-markdown'></div>
                    </Form.Item>
export const cherryConfig = {
  id: 'cherry-markdown',
  value: 'init',
  toolbars: toolbarsOptions,
  editor: {
    name: 'content',
    autoSave2Textarea: true
  }
}

Expected behavior

When I submit the form, I can obtain content data.

Screenshots
Other fields can obtain the (Input/Select) component

Environment (please complete the following information):

  • OS: [e.g. Windows/macOS] win11
  • Browser [e.g. Chrome, Safari]
  • Chrome
    版本 114.0.5735.201(正式版本) (64 位)
  • Version [e.g. 0.5.14] "cherry-markdown": "^0.8.21",

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Antd Form.Item example with the Cherry Markdown configuration and inspect how the editor's content is connected to the form field. The issue is resolved when submitting the form returns the entered content instead of undefined.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.