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

Select 官网示例模糊搜索不正确 #49415

Closed
crazyair opened this issue Jun 14, 2024 Discussed in #49411 · 3 comments
Closed

Select 官网示例模糊搜索不正确 #49415

crazyair opened this issue Jun 14, 2024 Discussed in #49411 · 3 comments

Comments

@crazyair
Copy link
Member

Discussed in #49411

Originally posted by crazyair June 14, 2024
https://ant-design.antgroup.com/components/select-cn#select-demo-search 这个示例,用了 optionFilterProp="children" 又用了 filterOption 导致必须在 filterOption 中使用 toLowerCase 对比,但是其实可以

<Select showSearch optionFilterProp="label" /> 

就可以,因为默认搜索用了 toUpperCase https://github.com/react-component/select/blob/66b66670c9cff5b44c75e2cb69da5599d74dd302/src/hooks/useFilterOptions.ts#L27

@afc163
Copy link
Member

afc163 commented Jun 15, 2024

这个例子主要演示 filterOption 的使用方式,去掉不妥。

@afc163
Copy link
Member

afc163 commented Jun 15, 2024

但是 optionFilterProp="children" 和 options 也确实有点看不懂,可以改成一个更适合 filterOption 的演示案例。

@crazyair
Copy link
Member Author

这个例子主要演示 filterOption 的使用方式,去掉不妥。

有2个了

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

No branches or pull requests

2 participants