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

[CascaderSelect]CascaderSelect 级联选择未能收缩二级菜单 #4472

Closed
kevinat opened this issue Oct 16, 2023 · 0 comments · Fixed by #4502
Closed

[CascaderSelect]CascaderSelect 级联选择未能收缩二级菜单 #4472

kevinat opened this issue Oct 16, 2023 · 0 comments · Fixed by #4502
Assignees
Labels
🐞 Bug Something isn't working Next release issues to close in next release

Comments

@kevinat
Copy link

kevinat commented Oct 16, 2023

Component

CascaderSelect

Steps to reproduce

多选情况下,如果先选择一个二级节点,再继续点击一个没有子节点的顶级节点时,二级菜单不会自动收回。

重现链接:
https://fusion.design/pc/component/cascader-select?themeid=2#expandedValue-container

按代码注释中把几个顶级节点的children置空就可以重现问题:

import { CascaderSelect } from '@alifd/next';

class Demo extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            data: []
        };

        this.handleChange = this.handleChange.bind(this);
    }

    componentDidMount() {
        fetch('https://os.alipayobjects.com/rmsportal/ODDwqcDFTLAguOvWEolX.json')
            .then(response => response.json())
            .then(data => {
                // 这里把几个顶级节点的children置空就可以重现问题
                data[1].children = [];
                data[2].children = [];
                this.setState({ data });
            })
            .catch(e => console.log(e));
    }

    handleChange(value, data, extra) {
        console.log(value, data, extra);
    }

    render() {
        return <CascaderSelect multiple dataSource={this.state.data} onChange={this.handleChange} />;
    }
}

ReactDOM.render(<Demo />, mountNode);

@YSMJ1994 YSMJ1994 added Next release issues to close in next release 🐞 Bug Something isn't working labels Oct 19, 2023
@YSMJ1994 YSMJ1994 self-assigned this Oct 27, 2023
YSMJ1994 added a commit that referenced this issue Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working Next release issues to close in next release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants