diff --git a/.changeset/calm-chairs-clean.md b/.changeset/calm-chairs-clean.md new file mode 100644 index 000000000..40442e640 --- /dev/null +++ b/.changeset/calm-chairs-clean.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(check-select): 修复 keyword 受控时搜索结果有误的问题 diff --git a/.changeset/spotty-crabs-crash.md b/.changeset/spotty-crabs-crash.md new file mode 100644 index 000000000..e62feb3a0 --- /dev/null +++ b/.changeset/spotty-crabs-crash.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/check-select": patch +--- + +fix: 修复 keyword 受控时搜索结果有误的问题 diff --git a/packages/ui/check-select/src/CheckSelect.tsx b/packages/ui/check-select/src/CheckSelect.tsx index fca501242..719bdbe86 100644 --- a/packages/ui/check-select/src/CheckSelect.tsx +++ b/packages/ui/check-select/src/CheckSelect.tsx @@ -78,6 +78,7 @@ export const CheckSelect = forwardRef( prefix, suffix, onKeyDown: onKeyDownProp, + keyword: keywordProp, ...rest }, ref @@ -139,6 +140,7 @@ export const CheckSelect = forwardRef( keyword: searchValue, } = useSearchMode({ searchable: searchableProp, + keyword: keywordProp, strategies: [dataSourceStrategy, customSearchStrategy, filterSearchStrategy], }) @@ -286,6 +288,7 @@ export const CheckSelect = forwardRef( onOpen={menuVisibleAction.on} onClose={menuVisibleAction.off} onKeyDown={mockDefaultHandlers(handleKeyDown, onKeyDownProp)} + keyword={keywordProp} searchable={searchable} scrollable={!inVirtual} onSearch={callAllFuncs(onSearchProp, onSearch)}