Skip to content

Commit d534dd8

Browse files
luozz1994罗忠泽thinkasanygithub-actions[bot]afc163
authored
fix: issue with echoing when the value of Select is an empty string. … (ant-design#56966)
* fix: issue with echoing when the value of Select is an empty string. ant-design#56960 * ci: add select's demo when defaultValue is empty * ci: trigger * test: update snap * chore: upgrade deps (ant-design#56977) Co-authored-by: afc163 <507615+afc163@users.noreply.github.com> * test: update demo for image diff (ant-design#56976) * chore: update @rc-component/select to v1.6.7 and update debug demo Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: update Input component snapshots Add updated snapshot tests for input component demo and demo-extend. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump deps * chore: trigger CI re-run * chore: format --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * ci: resolving conflicts. * chore(deps): update @rc-component/select to 1.6.9 * test: update snap --------- Co-authored-by: 罗忠泽 <victor.luo@spotterio.com> Co-authored-by: thinkasany <480968828@qq.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: afc163 <507615+afc163@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d271104 commit d534dd8

4 files changed

Lines changed: 238 additions & 1 deletion

File tree

components/select/__tests__/__snapshots__/demo-extend.test.ts.snap

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,181 @@ exports[`renders components/select/demo/debug.tsx extend context correctly 1`] =
22122212
</span>
22132213
</button>
22142214
</div>
2215+
<div
2216+
class="ant-space-item"
2217+
>
2218+
<div
2219+
class="ant-select ant-select-outlined css-var-test-id ant-select-css-var ant-select-single ant-select-show-arrow"
2220+
style="width: 120px;"
2221+
>
2222+
<div
2223+
class="ant-select-content"
2224+
title=" "
2225+
>
2226+
<input
2227+
aria-autocomplete="list"
2228+
aria-expanded="false"
2229+
aria-haspopup="listbox"
2230+
autocomplete="off"
2231+
class="ant-select-input"
2232+
id="test-id"
2233+
readonly=""
2234+
role="combobox"
2235+
type="search"
2236+
value=""
2237+
/>
2238+
</div>
2239+
<div
2240+
class="ant-select-suffix"
2241+
>
2242+
<span
2243+
aria-label="down"
2244+
class="anticon anticon-down"
2245+
role="img"
2246+
>
2247+
<svg
2248+
aria-hidden="true"
2249+
data-icon="down"
2250+
fill="currentColor"
2251+
focusable="false"
2252+
height="1em"
2253+
viewBox="64 64 896 896"
2254+
width="1em"
2255+
>
2256+
<path
2257+
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
2258+
/>
2259+
</svg>
2260+
</span>
2261+
</div>
2262+
</div>
2263+
<div
2264+
class="ant-select-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up css-var-test-id ant-select-css-var ant-select-dropdown-placement-bottomLeft"
2265+
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; right: auto; bottom: auto; box-sizing: border-box;"
2266+
>
2267+
<div>
2268+
<div
2269+
id="test-id_list"
2270+
role="listbox"
2271+
style="height: 0px; width: 0px; overflow: hidden;"
2272+
>
2273+
<div
2274+
aria-label="Jack"
2275+
aria-selected="false"
2276+
id="test-id_list_0"
2277+
role="option"
2278+
>
2279+
jack
2280+
</div>
2281+
<div
2282+
aria-label="Lucy"
2283+
aria-selected="false"
2284+
id="test-id_list_1"
2285+
role="option"
2286+
>
2287+
lucy
2288+
</div>
2289+
</div>
2290+
<div
2291+
class="rc-virtual-list"
2292+
style="position: relative;"
2293+
>
2294+
<div
2295+
class="rc-virtual-list-holder"
2296+
style="max-height: 256px; overflow-y: auto; overflow-anchor: none;"
2297+
>
2298+
<div>
2299+
<div
2300+
class="rc-virtual-list-holder-inner"
2301+
style="display: flex; flex-direction: column;"
2302+
>
2303+
<div
2304+
class="ant-select-item ant-select-item-option ant-select-item-option-active"
2305+
title="Jack"
2306+
>
2307+
<div
2308+
class="ant-select-item-option-content"
2309+
>
2310+
Jack
2311+
</div>
2312+
<span
2313+
aria-hidden="true"
2314+
class="ant-select-item-option-state"
2315+
style="user-select: none;"
2316+
unselectable="on"
2317+
/>
2318+
</div>
2319+
<div
2320+
class="ant-select-item ant-select-item-option"
2321+
title="Lucy"
2322+
>
2323+
<div
2324+
class="ant-select-item-option-content"
2325+
>
2326+
Lucy
2327+
</div>
2328+
<span
2329+
aria-hidden="true"
2330+
class="ant-select-item-option-state"
2331+
style="user-select: none;"
2332+
unselectable="on"
2333+
/>
2334+
</div>
2335+
<div
2336+
class="ant-select-item ant-select-item-option ant-select-item-option-disabled"
2337+
title="Disabled"
2338+
>
2339+
<div
2340+
class="ant-select-item-option-content"
2341+
>
2342+
Disabled
2343+
</div>
2344+
<span
2345+
aria-hidden="true"
2346+
class="ant-select-item-option-state"
2347+
style="user-select: none;"
2348+
unselectable="on"
2349+
/>
2350+
</div>
2351+
<div
2352+
class="ant-select-item ant-select-item-option"
2353+
title="yiminghe"
2354+
>
2355+
<div
2356+
class="ant-select-item-option-content"
2357+
>
2358+
yiminghe
2359+
</div>
2360+
<span
2361+
aria-hidden="true"
2362+
class="ant-select-item-option-state"
2363+
style="user-select: none;"
2364+
unselectable="on"
2365+
/>
2366+
</div>
2367+
<div
2368+
class="ant-select-item ant-select-item-option"
2369+
title="I am super super long!"
2370+
>
2371+
<div
2372+
class="ant-select-item-option-content"
2373+
>
2374+
I am super super long!
2375+
</div>
2376+
<span
2377+
aria-hidden="true"
2378+
class="ant-select-item-option-state"
2379+
style="user-select: none;"
2380+
unselectable="on"
2381+
/>
2382+
</div>
2383+
</div>
2384+
</div>
2385+
</div>
2386+
</div>
2387+
</div>
2388+
</div>
2389+
</div>
22152390
</div>
22162391
<div
22172392
style="width: 200px;"

components/select/__tests__/__snapshots__/demo.test.tsx.snap

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,55 @@ exports[`renders components/select/demo/debug.tsx correctly 1`] = `
926926
</span>
927927
</button>
928928
</div>
929+
<div
930+
class="ant-space-item"
931+
>
932+
<div
933+
class="ant-select ant-select-outlined css-var-test-id ant-select-css-var ant-select-single ant-select-show-arrow"
934+
style="width:120px"
935+
>
936+
<div
937+
class="ant-select-content"
938+
title=" "
939+
>
940+
<input
941+
aria-autocomplete="list"
942+
aria-expanded="false"
943+
aria-haspopup="listbox"
944+
autocomplete="off"
945+
class="ant-select-input"
946+
id="test-id"
947+
readonly=""
948+
role="combobox"
949+
type="search"
950+
value=""
951+
/>
952+
</div>
953+
<div
954+
class="ant-select-suffix"
955+
>
956+
<span
957+
aria-label="down"
958+
class="anticon anticon-down"
959+
role="img"
960+
>
961+
<svg
962+
aria-hidden="true"
963+
data-icon="down"
964+
fill="currentColor"
965+
focusable="false"
966+
height="1em"
967+
viewBox="64 64 896 896"
968+
width="1em"
969+
>
970+
<path
971+
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
972+
/>
973+
</svg>
974+
</span>
975+
</div>
976+
</div>
977+
</div>
929978
</div>
930979
<div
931980
style="width:200px"

components/select/demo/debug.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ const App: React.FC = () => (
4747
/>
4848
<span className="debug-align">AntDesign</span>
4949
<Button>222</Button>
50+
{/* https://github.com/ant-design/ant-design/issues/56960 */}
51+
<Select
52+
style={{ width: 120 }}
53+
defaultValue=" "
54+
placeholder="Please select"
55+
options={[
56+
{ value: 'jack', label: 'Jack' },
57+
{ value: 'lucy', label: 'Lucy' },
58+
{ value: 'disabled', disabled: true, label: 'Disabled' },
59+
{ value: 'Yiminghe', label: 'yiminghe' },
60+
{ value: 'long', label: 'I am super super long!' },
61+
]}
62+
/>
5063
</Space>
5164
<div style={{ width: 200 }}>
5265
{/* https://github.com/ant-design/ant-design/issues/54179 */}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"@rc-component/rate": "~1.0.1",
137137
"@rc-component/resize-observer": "^1.1.1",
138138
"@rc-component/segmented": "~1.3.0",
139-
"@rc-component/select": "~1.6.8",
139+
"@rc-component/select": "~1.6.9",
140140
"@rc-component/slider": "~1.0.1",
141141
"@rc-component/steps": "~1.2.2",
142142
"@rc-component/switch": "~1.0.3",

0 commit comments

Comments
 (0)