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

Directory Tree When scrolling is triggered in a child component, the parent component also scrolls #26246

Closed
1 task
superw-123 opened this issue Aug 17, 2020 · 8 comments
Labels
🤔 Need Reproduce We cannot reproduce your problem

Comments

@superw-123
Copy link

superw-123 commented Aug 17, 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

在codesanbox中没有复现,在本地由4.4.0升级到4.5.4后(这个升级是为了解决DirectoryTree滚动时节点丢失的问题即#26129
点击树节点,弹出popover,滚动popover中的内容,树上的节点跟着一起滚动

<DirectoryTree
    switcherIcon={<DownOutlined />}
    showIcon={false}
    onExpand={onExpand}
    expandedKeys={expandedKeys}
    autoExpandParent={autoExpandParent}
    height={treeHeight}
    treeData={renderTreeNodes(treeData)} />

const renderTreeNodes = data => (
    data.map(item => {
        const {title, titleCN, tree_id, is_table, children} = item;
        if (children) {
            return {title: title, key: tree_id, children: renderTreeNodes(children)};
        } else {
            return {title: onCustomLabel(item), key: tree_id};
        }
    })
);

const onCustomLabel = item => {
	 <span onClick={() => this.onSelect(item)}>
        <Popover content={<FieldMenu {...fieldProps} />}
            title={'test'}
            placement="rightTop"
            trigger="click"
            visible={visible}
            onVisibleChange={handleVisible}
            overlayClassName={Styles['drag-table-pop']}
        >
              
            <span>
                {item.title}
            </span>
        </Popover>
     </span>
}

What is expected?

滚动时不要穿透

What is actually happening?

滚动popover子组件里的内容,Directory tree父组件里的树节点也滚动

Environment Info
antd 4.5.4
React 16.12.0
System mac catalina 10.15.5
Browser 84.0.4147.125(正式版本) (64 位)
@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Aug 17, 2020
@ant-design-bot
Copy link
Contributor

Hello @superw-123. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @superw-123, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

@afc163
Copy link
Member

afc163 commented Aug 17, 2020

You can provide a minimal GitHub repository if it cannot reproduce in codesandbox.

@superw-123
Copy link
Author

You can provide a minimal GitHub repository if it cannot reproduce in codesandbox.

Hello @superw-123. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @superw-123, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

复现的示例,下载后,npm i,点击【点我点我点我】的节点,滚动鼠标,即可复现
https://github.com/superw-123/super/blob/master/dva-quickstart.zip

@afc163
Copy link
Member

afc163 commented Aug 18, 2020

Please provide a minimal reproduce instead of your whole project.

@superw-123
Copy link
Author

minimal

去掉codesanbox中的iframe就会复现
https://codesandbox.io/s/antd-reproduction-template-forked-f7buj?file=/index.js

@afc163
Copy link
Member

afc163 commented Aug 18, 2020

没有重现你描述的问题。

1

@ant-design-bot
Copy link
Contributor

This issue is closed because it has been marked as Need Reproduce, but has not had recent activity.
If you can provide a reproduce, feel free to ping anyone of our maintainers to reopen this issue.
Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

4 participants
@afc163 @ant-design-bot @superw-123 and others