From eee27bd5f81a89169c1c2dc993b9100731cafcbd Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Fri, 15 Mar 2024 10:54:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(check-select):=20=E4=BF=AE=E5=A4=8D=20keywo?= =?UTF-8?q?rd=20=E5=8F=97=E6=8E=A7=E6=97=B6=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=9C=89=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=20(#2766?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/calm-chairs-clean.md | 5 +++++ .changeset/spotty-crabs-crash.md | 5 +++++ packages/ui/check-select/src/CheckSelect.tsx | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 .changeset/calm-chairs-clean.md create mode 100644 .changeset/spotty-crabs-crash.md 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)}