Skip to content

Commit

Permalink
fix: placeholder (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyunhe authored Oct 16, 2024
1 parent 9a3074d commit ad94b3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/Selector/SingleSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ const SingleSelector: React.FC<SelectorProps> = (props) => {
attrs={pickAttrs(props, true)}
maxLength={combobox ? maxLength : undefined}
/>
{/* Display placeholder */}
{placeholderNode}
</span>

{/* Display value */}
Expand All @@ -121,6 +119,9 @@ const SingleSelector: React.FC<SelectorProps> = (props) => {
{item.label}
</span>
) : null}

{/* Display placeholder */}
{placeholderNode}
</span>
);
};
Expand Down
20 changes: 10 additions & 10 deletions tests/__snapshots__/Combobox.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ exports[`Select.Combobox renders controlled correctly 1`] = `
type="search"
value=""
/>
<span
class="rc-select-selection-placeholder"
>
Search
</span>
</span>
<span
class="rc-select-selection-placeholder"
>
Search
</span>
</span>
</div>
Expand Down Expand Up @@ -63,11 +63,11 @@ exports[`Select.Combobox renders correctly 1`] = `
type="search"
value=""
/>
<span
class="rc-select-selection-placeholder"
>
Search
</span>
</span>
<span
class="rc-select-selection-placeholder"
>
Search
</span>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/ssr.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-selector"><span class="rc-select-selection-wrap"><span class="rc-select-selection-search"><input type="search" autoComplete="off" class="rc-select-selection-search-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-owns="undefined_list" aria-autocomplete="list" aria-controls="undefined_list" readonly="" unselectable="on" style="opacity:0" value=""/><span class="rc-select-selection-placeholder"></span></span></span></div></div>"`;
exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-selector"><span class="rc-select-selection-wrap"><span class="rc-select-selection-search"><input type="search" autoComplete="off" class="rc-select-selection-search-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-owns="undefined_list" aria-autocomplete="list" aria-controls="undefined_list" readonly="" unselectable="on" style="opacity:0" value=""/></span><span class="rc-select-selection-placeholder"></span></span></div></div>"`;

0 comments on commit ad94b3b

Please sign in to comment.