From b30d2accaf434667a8d5acd799fd9c34a263870f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E8=89=B3=E5=85=B5?= Date: Tue, 30 Jun 2026 11:39:39 +0800 Subject: [PATCH] fix placeholder visibility inheritance --- src/SelectInput/Content/Placeholder.tsx | 2 +- tests/__snapshots__/Combobox.test.tsx.snap | 2 -- tests/__snapshots__/ssr.test.tsx.snap | 2 +- tests/placeholder.test.tsx | 13 +++++++++++++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/SelectInput/Content/Placeholder.tsx b/src/SelectInput/Content/Placeholder.tsx index fec17d9e0..4fba50f65 100644 --- a/src/SelectInput/Content/Placeholder.tsx +++ b/src/SelectInput/Content/Placeholder.tsx @@ -20,7 +20,7 @@ export default function Placeholder(props: PlaceholderProps) {
diff --git a/tests/__snapshots__/Combobox.test.tsx.snap b/tests/__snapshots__/Combobox.test.tsx.snap index 8e75469fe..4e4b36018 100644 --- a/tests/__snapshots__/Combobox.test.tsx.snap +++ b/tests/__snapshots__/Combobox.test.tsx.snap @@ -9,7 +9,6 @@ exports[`Select.Combobox renders controlled correctly 1`] = ` >
Search
@@ -37,7 +36,6 @@ exports[`Select.Combobox renders correctly 1`] = ` >
Search
diff --git a/tests/__snapshots__/ssr.test.tsx.snap b/tests/__snapshots__/ssr.test.tsx.snap index 9f1c6c0f9..de7ade80e 100644 --- a/tests/__snapshots__/ssr.test.tsx.snap +++ b/tests/__snapshots__/ssr.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Select.SSR should work 1`] = `"
"`; +exports[`Select.SSR should work 1`] = `"
"`; diff --git a/tests/placeholder.test.tsx b/tests/placeholder.test.tsx index ccca1c578..23f0b40b3 100644 --- a/tests/placeholder.test.tsx +++ b/tests/placeholder.test.tsx @@ -15,6 +15,19 @@ describe('Select placeholder', () => { }); }); + it('should not force placeholder visible when select is hidden', () => { + const { container } = render(); expect(container.querySelector('.rc-select-placeholder')).toBeTruthy();