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

fix(Select): add title for multiple option #2446

Merged
merged 3 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading