chore: merge master

This commit is contained in:
zombiej 2022-07-13 17:52:42 +08:00
commit 17f020f0a7
13 changed files with 1037 additions and 128 deletions

View File

@ -20,16 +20,34 @@ jobs:
if: github.event.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: make release
- name: release antd
uses: actions-cool/release-helper@v2
with:
triger: 'tag'
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
branch: 'master'
dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }} ${{ secrets.DINGDING_BOT_BIGFISH_TOKEN }}
dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }}
dingding-msg: 'CHANGELOG.zh-CN.md'
dingding-delay-minute: 10
msg-title: '# Ant Design {{v}} 发布日志'
msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ'
msg-footer: '💬 前往 [**Ant Design Releases**]({{url}}) 查看更新日志'
prettier: true
prerelease-filter: '-, a, b, A, B'
- name: release bigfish
uses: actions-cool/release-helper@v2
with:
triger: 'tag'
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
branch: 'master'
dingding-token: ${{ secrets.DINGDING_BOT_BIGFISH_TOKEN }}
dingding-msg: 'CHANGELOG.zh-CN.md'
dingding-delay-minute: 10
antd-conch-msg: '🐟 当前 Bigfish 内嵌 antd 版本:'
msg-title: '# Ant Design {{v}} 发布日志'
msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ'
msg-footer: '💬 前往 [**Ant Design Releases**]({{url}}) 查看更新日志'
prettier: true
prerelease-filter: '-, a, b, A, B'

View File

@ -846,6 +846,231 @@ Array [
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
style="box-shadow:0 0 3px red"
>
<div
class="ant-col ant-col-24 ant-form-item-label"
>
<label
class=""
for="basic_select"
title=""
>
<a
href="https://github.com/ant-design/ant-design/issues/36459"
>
#36459
</a>
</label>
</div>
<div
class="ant-col ant-col-24 ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<div
class="ant-select ant-select-in-form-item ant-select-multiple ant-select-show-search"
style="width:70%"
>
<div
class="ant-select-selector"
>
<div
class="ant-select-selection-overflow"
>
<div
class="ant-select-selection-overflow-item"
style="opacity:1"
>
<span
class="ant-select-selection-item"
title="Bamboo"
>
<span
class="ant-select-selection-item-content"
>
Bamboo
</span>
<span
aria-hidden="true"
class="ant-select-selection-item-remove"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</span>
</span>
</div>
<div
class="ant-select-selection-overflow-item ant-select-selection-overflow-item-suffix"
style="opacity:1"
>
<div
class="ant-select-selection-search"
style="width:0"
>
<input
aria-activedescendant="basic_select_list_0"
aria-autocomplete="list"
aria-controls="basic_select_list"
aria-haspopup="listbox"
aria-owns="basic_select_list"
autocomplete="off"
class="ant-select-selection-search-input"
id="basic_select"
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
<span
aria-hidden="true"
class="ant-select-selection-search-mirror"
>
 
</span>
</div>
</div>
</div>
</div>
<div>
<div
class="ant-select-dropdown"
style="opacity:0"
>
<div>
<div
id="basic_select_list"
role="listbox"
style="height:0;width:0;overflow:hidden"
>
<div
aria-label="Bamboo"
aria-selected="true"
id="basic_select_list_0"
role="option"
>
bamboo
</div>
<div
aria-label="Little"
aria-selected="false"
id="basic_select_list_1"
role="option"
>
little
</div>
</div>
<div
class="rc-virtual-list"
style="position:relative"
>
<div
class="rc-virtual-list-holder"
style="max-height:256px;overflow-y:auto;overflow-anchor:none"
>
<div>
<div
class="rc-virtual-list-holder-inner"
style="display:flex;flex-direction:column"
>
<div
aria-selected="true"
class="ant-select-item ant-select-item-option ant-select-item-option-active ant-select-item-option-selected"
title="Bamboo"
>
<div
class="ant-select-item-option-content"
>
Bamboo
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="check"
class="anticon anticon-check"
role="img"
>
<svg
aria-hidden="true"
data-icon="check"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
/>
</svg>
</span>
</span>
</div>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
title="Little"
>
<div
class="ant-select-item-option-content"
>
Little
</div>
</div>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
title="Light"
>
<div
class="ant-select-item-option-content"
>
Light
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
@ -999,6 +1224,239 @@ Array [
</div>
</div>
</form>,
<div
class="ant-divider ant-divider-horizontal"
role="separator"
/>,
<form
class="ant-form ant-form-vertical"
>
<div
class="ant-row ant-form-item"
style="box-shadow:0 0 3px red"
>
<div
class="ant-col ant-form-item-label"
>
<label
class=""
for="select"
title=""
>
<a
href="https://github.com/ant-design/ant-design/issues/36459"
>
#36459
</a>
</label>
</div>
<div
class="ant-col ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<div
class="ant-select ant-select-in-form-item ant-select-multiple ant-select-show-search"
style="width:70%"
>
<div
class="ant-select-selector"
>
<div
class="ant-select-selection-overflow"
>
<div
class="ant-select-selection-overflow-item"
style="opacity:1"
>
<span
class="ant-select-selection-item"
title="Bamboo"
>
<span
class="ant-select-selection-item-content"
>
Bamboo
</span>
<span
aria-hidden="true"
class="ant-select-selection-item-remove"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</span>
</span>
</div>
<div
class="ant-select-selection-overflow-item ant-select-selection-overflow-item-suffix"
style="opacity:1"
>
<div
class="ant-select-selection-search"
style="width:0"
>
<input
aria-activedescendant="select_list_0"
aria-autocomplete="list"
aria-controls="select_list"
aria-haspopup="listbox"
aria-owns="select_list"
autocomplete="off"
class="ant-select-selection-search-input"
id="select"
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
<span
aria-hidden="true"
class="ant-select-selection-search-mirror"
>
 
</span>
</div>
</div>
</div>
</div>
<div>
<div
class="ant-select-dropdown"
style="opacity:0"
>
<div>
<div
id="select_list"
role="listbox"
style="height:0;width:0;overflow:hidden"
>
<div
aria-label="Bamboo"
aria-selected="true"
id="select_list_0"
role="option"
>
bamboo
</div>
<div
aria-label="Little"
aria-selected="false"
id="select_list_1"
role="option"
>
little
</div>
</div>
<div
class="rc-virtual-list"
style="position:relative"
>
<div
class="rc-virtual-list-holder"
style="max-height:256px;overflow-y:auto;overflow-anchor:none"
>
<div>
<div
class="rc-virtual-list-holder-inner"
style="display:flex;flex-direction:column"
>
<div
aria-selected="true"
class="ant-select-item ant-select-item-option ant-select-item-option-active ant-select-item-option-selected"
title="Bamboo"
>
<div
class="ant-select-item-option-content"
>
Bamboo
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="check"
class="anticon anticon-check"
role="img"
>
<svg
aria-hidden="true"
data-icon="check"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
/>
</svg>
</span>
</span>
</div>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
title="Little"
>
<div
class="ant-select-item-option-content"
>
Little
</div>
</div>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
title="Light"
>
<div
class="ant-select-item-option-content"
>
Light
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>,
]
`;

View File

@ -682,6 +682,124 @@ Array [
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
style="box-shadow:0 0 3px red"
>
<div
class="ant-col ant-col-24 ant-form-item-label"
>
<label
class=""
for="basic_select"
title=""
>
<a
href="https://github.com/ant-design/ant-design/issues/36459"
>
#36459
</a>
</label>
</div>
<div
class="ant-col ant-col-24 ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<div
class="ant-select ant-select-in-form-item ant-select-multiple ant-select-show-search"
style="width:70%"
>
<div
class="ant-select-selector"
>
<div
class="ant-select-selection-overflow"
>
<div
class="ant-select-selection-overflow-item"
style="opacity:1"
>
<span
class="ant-select-selection-item"
title="Bamboo"
>
<span
class="ant-select-selection-item-content"
>
Bamboo
</span>
<span
aria-hidden="true"
class="ant-select-selection-item-remove"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</span>
</span>
</div>
<div
class="ant-select-selection-overflow-item ant-select-selection-overflow-item-suffix"
style="opacity:1"
>
<div
class="ant-select-selection-search"
style="width:0"
>
<input
aria-activedescendant="basic_select_list_0"
aria-autocomplete="list"
aria-controls="basic_select_list"
aria-haspopup="listbox"
aria-owns="basic_select_list"
autocomplete="off"
class="ant-select-selection-search-input"
id="basic_select"
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
<span
aria-hidden="true"
class="ant-select-selection-search-mirror"
>
 
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
@ -835,6 +953,132 @@ Array [
</div>
</div>
</form>,
<div
class="ant-divider ant-divider-horizontal"
role="separator"
/>,
<form
class="ant-form ant-form-vertical"
>
<div
class="ant-row ant-form-item"
style="box-shadow:0 0 3px red"
>
<div
class="ant-col ant-form-item-label"
>
<label
class=""
for="select"
title=""
>
<a
href="https://github.com/ant-design/ant-design/issues/36459"
>
#36459
</a>
</label>
</div>
<div
class="ant-col ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<div
class="ant-select ant-select-in-form-item ant-select-multiple ant-select-show-search"
style="width:70%"
>
<div
class="ant-select-selector"
>
<div
class="ant-select-selection-overflow"
>
<div
class="ant-select-selection-overflow-item"
style="opacity:1"
>
<span
class="ant-select-selection-item"
title="Bamboo"
>
<span
class="ant-select-selection-item-content"
>
Bamboo
</span>
<span
aria-hidden="true"
class="ant-select-selection-item-remove"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</span>
</span>
</div>
<div
class="ant-select-selection-overflow-item ant-select-selection-overflow-item-suffix"
style="opacity:1"
>
<div
class="ant-select-selection-search"
style="width:0"
>
<input
aria-activedescendant="select_list_0"
aria-autocomplete="list"
aria-controls="select_list"
aria-haspopup="listbox"
aria-owns="select_list"
autocomplete="off"
class="ant-select-selection-search-input"
id="select"
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
<span
aria-hidden="true"
class="ant-select-selection-search-mirror"
>
 
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>,
]
`;

View File

@ -15,9 +15,28 @@ See issue [#32980](https://github.com/ant-design/ant-design/issues/32980).
See issue [#32980](https://github.com/ant-design/ant-design/issues/32980).
```tsx
import { Button, Form, Input } from 'antd';
import { Button, Select, Form, Input, Divider } from 'antd';
import React from 'react';
const sharedItem = (
<Form.Item
label={<a href="https://github.com/ant-design/ant-design/issues/36459">#36459</a>}
initialValue={['bamboo']}
name="select"
style={{ boxShadow: '0 0 3px red' }}
>
<Select
style={{ width: '70%' }}
mode="multiple"
options={[
{ label: 'Bamboo', value: 'bamboo' },
{ label: 'Little', value: 'little' },
{ label: 'Light', value: 'light' },
]}
/>
</Form.Item>
);
const App: React.FC = () => {
const onFinish = (values: any) => {
console.log('Success:', values);
@ -54,6 +73,8 @@ const App: React.FC = () => {
<Input.Password />
</Form.Item>
{sharedItem}
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
@ -91,6 +112,10 @@ const App: React.FC = () => {
</Button>
</Form.Item>
</Form>
<Divider />
<Form layout="vertical">{sharedItem}</Form>
</>
);
};

View File

@ -478,6 +478,10 @@ const genVerticalStyle: GenerateStyle<FormToken> = token => {
'&-label > label': {
height: 'auto',
},
[`${componentCls}-item-control`]: {
width: '100%',
},
},
},

View File

@ -1361,18 +1361,9 @@ exports[`renders ./components/layout/demo/fixed-sider.md extend context correctl
class="site-layout-background"
style="padding:24px;text-align:center"
>
...
<br />
Really
<br />
...
<br />
...
<br />
...
<br />
long
<br />
<p>
long content
</p>
...
<br />
...
@ -1413,7 +1404,7 @@ exports[`renders ./components/layout/demo/fixed-sider.md extend context correctl
<br />
...
<br />
...
more
<br />
...
<br />
@ -1453,9 +1444,126 @@ exports[`renders ./components/layout/demo/fixed-sider.md extend context correctl
<br />
...
<br />
more
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
more
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
more
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
content
</div>
</main>
<footer

View File

@ -731,18 +731,9 @@ exports[`renders ./components/layout/demo/fixed-sider.md correctly 1`] = `
class="site-layout-background"
style="padding:24px;text-align:center"
>
...
<br />
Really
<br />
...
<br />
...
<br />
...
<br />
long
<br />
<p>
long content
</p>
...
<br />
...
@ -783,7 +774,7 @@ exports[`renders ./components/layout/demo/fixed-sider.md correctly 1`] = `
<br />
...
<br />
...
more
<br />
...
<br />
@ -823,9 +814,126 @@ exports[`renders ./components/layout/demo/fixed-sider.md correctly 1`] = `
<br />
...
<br />
more
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
more
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
more
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
content
</div>
</main>
<footer

View File

@ -65,101 +65,16 @@ const App: React.FC = () => (
<Header className="site-layout-background" style={{ padding: 0 }} />
<Content style={{ margin: '24px 16px 0', overflow: 'initial' }}>
<div className="site-layout-background" style={{ padding: 24, textAlign: 'center' }}>
...
<br />
Really
<br />
...
<br />
...
<br />
...
<br />
long
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
...
<br />
content
<p>long content</p>
{
// indicates very long content
Array.from({ length: 100 }, (_, index) => (
<React.Fragment key={index}>
{index % 20 === 0 && index ? 'more' : '...'}
<br />
</React.Fragment>
))
}
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>Ant Design ©2018 Created by Ant UED</Footer>

View File

@ -18,9 +18,11 @@ interface CompoundedComponent
extends React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLElement>> {
Group: typeof Group;
Button: typeof Button;
__ANT_RADIO: boolean;
}
const Radio = InternalRadio as CompoundedComponent;
Radio.Button = Button;
Radio.Group = Group;
Radio.__ANT_RADIO = true;
export default Radio;

View File

@ -104,6 +104,12 @@ const genExpandStyle: GenerateStyle<TableToken, CSSObject> = token => {
border: 0,
visibility: 'hidden',
},
[`+ ${componentCls}-cell-content`]: {
display: 'inline-block !important',
width: `calc(100% - (${expandIconSize}px + ${paddingXS}px))`,
verticalAlign: 'top',
},
},
[`${componentCls}-row-indent + ${componentCls}-row-expand-icon`]: {

View File

@ -9,6 +9,7 @@ import DatePicker from '../../date-picker';
import Input from '../../input';
import Group from '../../input/Group';
import Switch from '../../switch';
import Radio from '../../radio';
describe('Tooltip', () => {
mountTest(Tooltip);
@ -402,4 +403,23 @@ describe('Tooltip', () => {
expect(onVisibleChange).toHaveBeenLastCalledWith(true);
expect(container.querySelector('.ant-tooltip-open')).not.toBeNull();
});
it('should work with disabled Radio', () => {
const onVisibleChange = jest.fn();
const { container } = render(
<Tooltip
title="loading tips"
mouseEnterDelay={0}
mouseLeaveDelay={0}
onVisibleChange={onVisibleChange}
>
<Radio disabled />
</Tooltip>,
);
const wrapperEl = container.querySelectorAll('.ant-tooltip-disabled-compatible-wrapper');
expect(wrapperEl).toHaveLength(1);
fireEvent.mouseEnter(container.getElementsByTagName('span')[0]);
expect(onVisibleChange).toHaveBeenLastCalledWith(true);
expect(container.querySelector('.ant-tooltip-open')).not.toBeNull();
});
});

View File

@ -89,7 +89,8 @@ function getDisabledCompatibleChildren(element: React.ReactElement<any>, prefixC
const elementType = element.type as any;
if (
((elementType.__ANT_BUTTON === true || element.type === 'button') && element.props.disabled) ||
(elementType.__ANT_SWITCH === true && (element.props.disabled || element.props.loading))
(elementType.__ANT_SWITCH === true && (element.props.disabled || element.props.loading)) ||
(elementType.__ANT_RADIO === true && element.props.disabled)
) {
// Pick some layout related style properties up to span
// Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254

View File

@ -146,7 +146,7 @@
"rc-table": "~7.25.0",
"rc-tabs": "~11.16.0",
"rc-textarea": "~0.3.0",
"rc-tooltip": "~5.1.1",
"rc-tooltip": "~5.2.0",
"rc-tree": "~5.6.5",
"rc-tree-select": "~5.4.0",
"rc-trigger": "^5.2.10",