Skip to content

Commit

Permalink
fix(check-select): 修复 keyword 受控时搜索结果有误的问题 (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed Mar 15, 2024
1 parent 1f88f9a commit eee27bd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-chairs-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

fix(check-select): 修复 keyword 受控时搜索结果有误的问题
5 changes: 5 additions & 0 deletions .changeset/spotty-crabs-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/check-select": patch
---

fix: 修复 keyword 受控时搜索结果有误的问题
3 changes: 3 additions & 0 deletions packages/ui/check-select/src/CheckSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const CheckSelect = forwardRef<HTMLDivElement | null, CheckSelectProps>(
prefix,
suffix,
onKeyDown: onKeyDownProp,
keyword: keywordProp,
...rest
},
ref
Expand Down Expand Up @@ -139,6 +140,7 @@ export const CheckSelect = forwardRef<HTMLDivElement | null, CheckSelectProps>(
keyword: searchValue,
} = useSearchMode({
searchable: searchableProp,
keyword: keywordProp,
strategies: [dataSourceStrategy, customSearchStrategy, filterSearchStrategy],
})

Expand Down Expand Up @@ -286,6 +288,7 @@ export const CheckSelect = forwardRef<HTMLDivElement | null, CheckSelectProps>(
onOpen={menuVisibleAction.on}
onClose={menuVisibleAction.off}
onKeyDown={mockDefaultHandlers(handleKeyDown, onKeyDownProp)}
keyword={keywordProp}
searchable={searchable}
scrollable={!inVirtual}
onSearch={callAllFuncs(onSearchProp, onSearch)}
Expand Down

0 comments on commit eee27bd

Please sign in to comment.