From 169008ec0c7b5106629dd004a9fefb2d37342114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B9=A4=E4=BB=99?= Date: Tue, 15 Oct 2024 17:19:50 +0800 Subject: [PATCH] fix: placeholder --- src/Selector/SingleSelector.tsx | 5 +++-- tests/__snapshots__/Combobox.test.tsx.snap | 20 ++++++++++---------- tests/__snapshots__/ssr.test.tsx.snap | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Selector/SingleSelector.tsx b/src/Selector/SingleSelector.tsx index 7f71adf8..c384a59d 100644 --- a/src/Selector/SingleSelector.tsx +++ b/src/Selector/SingleSelector.tsx @@ -104,8 +104,6 @@ const SingleSelector: React.FC = (props) => { attrs={pickAttrs(props, true)} maxLength={combobox ? maxLength : undefined} /> - {/* Display placeholder */} - {placeholderNode} {/* Display value */} @@ -121,6 +119,9 @@ const SingleSelector: React.FC = (props) => { {item.label} ) : null} + + {/* Display placeholder */} + {placeholderNode} ); }; diff --git a/tests/__snapshots__/Combobox.test.tsx.snap b/tests/__snapshots__/Combobox.test.tsx.snap index 7d8f82d1..8efa34f8 100644 --- a/tests/__snapshots__/Combobox.test.tsx.snap +++ b/tests/__snapshots__/Combobox.test.tsx.snap @@ -26,11 +26,11 @@ exports[`Select.Combobox renders controlled correctly 1`] = ` type="search" value="" /> - - Search - + + + Search @@ -63,11 +63,11 @@ exports[`Select.Combobox renders correctly 1`] = ` type="search" value="" /> - - Search - + + + Search diff --git a/tests/__snapshots__/ssr.test.tsx.snap b/tests/__snapshots__/ssr.test.tsx.snap index 8594094b..0ed2eda8 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`] = `"
"`;