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

Official Demo window alerts for 'please select more than two item or less than one item.' #379

Open
z27fang opened this issue Aug 12, 2021 · 0 comments

Comments

@z27fang
Copy link

z27fang commented Aug 12, 2021

1. What's the issue?
https://tree-select.react-component.vercel.app/?path=/story/rc-tree-select--basic
On this official demo page, if you go to 'check select' section and check 2 values, it will alert for the message given in title.

2. How to reproduce?
image

3. What's the expected behavior?
Not showing this alert and allowing for selecting arbitrary number of values, or give some explanation of why this is happening.

读了下代码似乎是用来展示onDropdownVisibleChange,是否需要标注一下用途以防误以为是bug呢?

onDropdownVisibleChange = visible => {
const { value } = this.state;
console.log(visible, value);
if (Array.isArray(value) && value.length > 1 && value.length < 3) {
window.alert('please select more than two item or less than one item.');
return false;
}
return true;
};

如有需要我可以提交一个pr对此功能再demo页面上做些介绍。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant