Skip to content

Commit

Permalink
fix: filterOption add type
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeZhang committed Sep 15, 2020
1 parent 91348ac commit 18dddbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/easy-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ class EasySelect extends React.Component<any, any> {
showSearch={showSearch} // 默认支持查询
style={{ minWidth: 120 }} // todo: 暂时样式,有待商榷
onSearch={ servise && !filterLocal ? this.onSearch : null }
filterOption={ !filterLocal ? null : (input, option) =>
filterOption={ !filterLocal ? null : (input: any, option: any) =>
// 兼容数字和字符串等模糊查询
option.props?.children?.toString().toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
option.props?.value?.toString().toLowerCase().indexOf(input.toLowerCase()) >= 0
option.props.children.toString().toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
option.props.value.toString().toLowerCase().indexOf(input.toLowerCase()) >= 0
}
onPopupScroll={this.companyScroll}
{ ...others }
Expand Down

0 comments on commit 18dddbb

Please sign in to comment.