Skip to content

Commit

Permalink
chore: adjust logic
Browse files Browse the repository at this point in the history
  • Loading branch information
aojunhao123 committed Nov 6, 2024
1 parent 229f4f7 commit 9c7ad27
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/OptionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,10 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
return firstNode ? firstNode[fieldNames.value] : null;
};

// search mode active first node
if (searchValue) {
nextActiveKey = getFirstNode();
}
// single mode active first checked node
else if (!multiple && checkedKeys.length) {
if (!multiple && checkedKeys.length && !searchValue) {
nextActiveKey = checkedKeys[0];
}
// default active first node
else {
} else {
nextActiveKey = getFirstNode();
}

Expand Down

0 comments on commit 9c7ad27

Please sign in to comment.