Skip to content

Commit f09e41e

Browse files
authored
demo: fix Radio demo style (ant-design#56903)
* demo: fix Radio demo style * update snap
1 parent cee8298 commit f09e41e

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx extend context correc
15611561
>
15621562
<label
15631563
class="ant-radio-wrapper ant-radio-wrapper-checked css-var-test-id ant-radio-css-var"
1564+
style="height: 32px; line-height: 32px;"
15641565
>
15651566
<span
15661567
class="ant-radio ant-wave-target ant-radio-checked"
@@ -1584,6 +1585,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx extend context correc
15841585
</label>
15851586
<label
15861587
class="ant-radio-wrapper css-var-test-id ant-radio-css-var"
1588+
style="height: 32px; line-height: 32px;"
15871589
>
15881590
<span
15891591
class="ant-radio ant-wave-target"
@@ -1606,6 +1608,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx extend context correc
16061608
</label>
16071609
<label
16081610
class="ant-radio-wrapper css-var-test-id ant-radio-css-var"
1611+
style="height: 32px; line-height: 32px;"
16091612
>
16101613
<span
16111614
class="ant-radio ant-wave-target"
@@ -1628,6 +1631,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx extend context correc
16281631
</label>
16291632
<label
16301633
class="ant-radio-wrapper css-var-test-id ant-radio-css-var"
1634+
style="height: 32px; line-height: 32px;"
16311635
>
16321636
<span
16331637
class="ant-radio ant-wave-target"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx correctly 1`] = `
15431543
>
15441544
<label
15451545
class="ant-radio-wrapper ant-radio-wrapper-checked css-var-test-id ant-radio-css-var"
1546+
style="height:32px;line-height:32px"
15461547
>
15471548
<span
15481549
class="ant-radio ant-wave-target ant-radio-checked"
@@ -1566,6 +1567,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx correctly 1`] = `
15661567
</label>
15671568
<label
15681569
class="ant-radio-wrapper css-var-test-id ant-radio-css-var"
1570+
style="height:32px;line-height:32px"
15691571
>
15701572
<span
15711573
class="ant-radio ant-wave-target"
@@ -1588,6 +1590,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx correctly 1`] = `
15881590
</label>
15891591
<label
15901592
class="ant-radio-wrapper css-var-test-id ant-radio-css-var"
1593+
style="height:32px;line-height:32px"
15911594
>
15921595
<span
15931596
class="ant-radio ant-wave-target"
@@ -1610,6 +1613,7 @@ exports[`renders components/radio/demo/radiogroup-more.tsx correctly 1`] = `
16101613
</label>
16111614
<label
16121615
class="ant-radio-wrapper css-var-test-id ant-radio-css-var"
1616+
style="height:32px;line-height:32px"
16131617
>
16141618
<span
16151619
class="ant-radio ant-wave-target"

components/radio/demo/radiogroup-more.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import React, { useState } from 'react';
22
import type { RadioChangeEvent } from 'antd';
33
import { Input, Radio } from 'antd';
44

5+
const labelStyle: React.CSSProperties = {
6+
height: 32,
7+
lineHeight: '32px',
8+
};
9+
510
const App: React.FC = () => {
611
const [value, setValue] = useState(1);
712

@@ -15,11 +20,12 @@ const App: React.FC = () => {
1520
onChange={onChange}
1621
value={value}
1722
options={[
18-
{ value: 1, label: 'Option A' },
19-
{ value: 2, label: 'Option B' },
20-
{ value: 3, label: 'Option C' },
23+
{ value: 1, style: labelStyle, label: 'Option A' },
24+
{ value: 2, style: labelStyle, label: 'Option B' },
25+
{ value: 3, style: labelStyle, label: 'Option C' },
2126
{
2227
value: 4,
28+
style: labelStyle,
2329
label: (
2430
<>
2531
More...

0 commit comments

Comments
 (0)