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

Space组件内部使用Fragment标签时,Fragment标签被识别为一个Space的子项 #26420

Closed
1 task
Loving-Vincent opened this issue Aug 26, 2020 · 2 comments · Fixed by #26444
Closed
1 task
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 👷🏻‍♂️ Someone working on it

Comments

@Loving-Vincent
Copy link

Loving-Vincent commented Aug 26, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Antd 4.6.0 之后, Space组件内部使用的Fragment标签出现问题,导致Fragment标签内部所有元素被识别为一个space-item,不符合Fragment标签的使用逻辑。4.6.0之前的版本是OK的,可能是4.6修改Space时引发了这个问题。

image

image

What is expected?

正确解析Fragment标签,并将Fragment内部所有元素解析为一个单独space的子项。

What is actually happening?

Space组件将Fragment解析为一个子项

Environment Info
antd 4.6.1
React ^16.12.0
System MacOS
Browser Chrome 84
@xrkffgg
Copy link
Member

xrkffgg commented Aug 26, 2020

Suggest

<Space>
    Space
    <Space>
        <Button type="primary">Button</Button>
        <Button type="primary">Button</Button>
    </Space>
    <Button type="primary">Button</Button>
    <Upload>
        <Button>
            <UploadOutlined /> Click to Upload
        </Button>
    </Upload>
</Space>

@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Aug 27, 2020
@zombieJ
Copy link
Member

zombieJ commented Aug 28, 2020

蛋疼,rc-util 的 toArray 拓展一下好了。否则又要完成重复一遍这个代码。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 👷🏻‍♂️ Someone working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants