限制图片数量为一个时,上传图片高度会突变

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start with the Upload component and reproduce the issue using listType="picture-card", fileList limited to one item, and an auto-height parent. Confirm that adding the image does not cause a temporary height change, and add or update coverage if the repository has a relevant test entry point.

Written by the indexing model from the issue text.

Description

比如下边这个例子,如果父容器是高度自适应的话,添加图片时高度会突变一下。

<Upload
      action="/api/file/upload"
      listType="picture-card"
      onChange={onChange}
      fileList={fileList}
    >
      {fileList.length < 1 ? (
        <div>
          <Icon type={loading ? 'loading' : 'plus'} />
          <div>上传</div>
        </div>
      ) : null}
    </Upload>
Dominant language
TypeScript
Stars
804
Forks
323
Avg merge
12m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

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.

More from react-component/upload

All issues in react-component/upload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.