From e2086b04807aaac22739529c3a04eac0383b32fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Fri, 30 Jan 2026 22:26:11 +0800 Subject: [PATCH 1/2] chore: add more cls --- src/SelectInput/Content/SingleContent.tsx | 2 ++ tests/Select.test.tsx | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/SelectInput/Content/SingleContent.tsx b/src/SelectInput/Content/SingleContent.tsx index ca481240..3a731a38 100644 --- a/src/SelectInput/Content/SingleContent.tsx +++ b/src/SelectInput/Content/SingleContent.tsx @@ -89,6 +89,8 @@ const SingleContent = React.forwardRef( className={clsx( `${prefixCls}-content`, displayValue && `${prefixCls}-content-has-value`, + mergedSearchValue && `${prefixCls}-content-has-search-value`, + hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content, )} style={styles?.content} diff --git a/tests/Select.test.tsx b/tests/Select.test.tsx index 721df3bf..998865e4 100644 --- a/tests/Select.test.tsx +++ b/tests/Select.test.tsx @@ -255,6 +255,24 @@ describe('Select.Basic', () => { ); }); + it('should add -content-has-search-value className when searching', () => { + const { container } = render( + + , + ); + expect(container.querySelector('.rc-select-content-value')).toBeTruthy(); + }); + it('should default select the right option', () => { const { container } = render( , ); - expect(container.querySelector('.rc-select-content-value')).toBeTruthy(); + expect(container.querySelector('.rc-select-content-has-option-style')).toBeTruthy(); }); it('should default select the right option', () => {