Skip to content

Commit

Permalink
fix(Select): add title for multiple option (#2446)
Browse files Browse the repository at this point in the history
* fix(Select): add title for multiple option

* fix(Select): disable internal filter when onsearch

* chore: select demo
  • Loading branch information
uyarn authored Aug 16, 2023
1 parent f098db6 commit e5d3aa4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/select/_example/remote-search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ const RemoteSearchSelect = () => {
if (search) {
options = [
{
value: `${search}_test1`,
label: `${search}_test1`,
value: `腾讯_test1`,
label: `腾讯_test1`,
},
{
value: `${search}_test2`,
label: `${search}_test2`,
value: `腾讯_test2`,
label: `腾讯_test2`,
},
{
value: `${search}_test3`,
label: `${search}_test3`,
value: `腾讯_test3`,
label: `腾讯_test3`,
},
];
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/select/_example/scroll-bottom.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ScrollBottom() {
// 通过滚动事件自行判断
// const handleScroll = ({ e }) => {
// const { scrollTop, clientHeight, scrollHeight } = e.target;
// if (scrollHeight - scrollTop === clientHeight) {
// if (clientHeight + Math.floor(scrollTop) === scrollHeight) {
// console.log('到底部了');
// changeDynamicOptions((dynamicOptions) =>
// dynamicOptions.concat({
Expand Down
1 change: 1 addition & 0 deletions src/select/base/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const Option = (props: SelectOptionProps) => {
[`${classPrefix}-is-disabled`]: disabled,
[`${classPrefix}-is-checked`]: selected,
})}
title={propTitle || (label as string)}
>
<input
type="checkbox"
Expand Down
2 changes: 2 additions & 0 deletions src/select/base/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ const Select = forwardRefWithStatics(
// 处理filter逻辑
const handleFilter = (value: string) => {
let filteredOptions: OptionsType = [];
if (filterable && isFunction(onSearch)) return;

if (!value) {
setCurrentOptions(tmpPropOptions);
return;
Expand Down

0 comments on commit e5d3aa4

Please sign in to comment.