Merge branch 'master' into next

This commit is contained in:
zombiej 2022-03-15 14:14:14 +08:00
commit a338a1b00e
9 changed files with 18 additions and 10 deletions

View File

@ -1,8 +1,8 @@
export default function getDataOrAriaProps(props: any) {
return Object.keys(props).reduce((prev: any, key: string) => {
if (
(key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') &&
key.substr(0, 7) !== 'data-__'
(key.startsWith('data-') || key.startsWith('aria-') || key === 'role') &&
!key.startsWith('data-__')
) {
prev[key] = props[key];
}

View File

@ -21043,6 +21043,7 @@ exports[`ConfigProvider components Select configProvider 1`] = `
>
<div
class="config-select-item config-select-item-group"
title="grp"
>
grp
</div>
@ -21170,6 +21171,7 @@ exports[`ConfigProvider components Select configProvider componentSize large 1`]
>
<div
class="config-select-item config-select-item-group"
title="grp"
>
grp
</div>
@ -21297,6 +21299,7 @@ exports[`ConfigProvider components Select configProvider componentSize middle 1`
>
<div
class="config-select-item config-select-item-group"
title="grp"
>
grp
</div>
@ -21424,6 +21427,7 @@ exports[`ConfigProvider components Select configProvider virtual and dropdownMat
>
<div
class="ant-select-item ant-select-item-group"
title="grp"
>
grp
</div>
@ -21551,6 +21555,7 @@ exports[`ConfigProvider components Select normal 1`] = `
>
<div
class="ant-select-item ant-select-item-group"
title="grp"
>
grp
</div>
@ -21678,6 +21683,7 @@ exports[`ConfigProvider components Select prefixCls 1`] = `
>
<div
class="prefix-Select-item prefix-Select-item-group"
title="grp"
>
grp
</div>

View File

@ -3815,6 +3815,7 @@ exports[`renders ./components/select/demo/optgroup.md extend context correctly 1
>
<div
class="ant-select-item ant-select-item-group"
title="Manager"
>
Manager
</div>
@ -3854,6 +3855,7 @@ exports[`renders ./components/select/demo/optgroup.md extend context correctly 1
</div>
<div
class="ant-select-item ant-select-item-group"
title="Engineer"
>
Engineer
</div>

View File

@ -7,11 +7,11 @@ title:
## zh-CN
使用 `dropdownRender` 对下拉菜单进行自由扩展。
使用 `dropdownRender` 对下拉菜单进行自由扩展。自定义内容点击时会关闭浮层,如果不喜欢关闭,可以添加 `onMouseDown={e => e.preventDefault()}` 进行阻止(更多详情见 [#13448](https://github.com/ant-design/ant-design/issues/13448))。
## en-US
Customize the dropdown menu via `dropdownRender`.
Customize the dropdown menu via `dropdownRender`. Dropdown menu will be closed if click `dropdownRender` area, you can prevent it by wrapping `onMouseDown={e => e.preventDefault()}` (see more at [#13448](https://github.com/ant-design/ant-design/issues/13448)).
```jsx
import React, { useState } from 'react';

View File

@ -113,7 +113,7 @@ It's caused by option with different `label` and `value`. You can use `optionFil
### The dropdown is closed when click `dropdownRender` area?
See the instruction in [dropdownRender example](#components-select-demo-custom-dropdown-menu).
Dropdown menu will be closed if click `dropdownRender` area, you can prevent it by wrapping `onMouseDown={e => e.preventDefault()}` (see more at [#13448](https://github.com/ant-design/ant-design/issues/13448)).
### Why sometime customize Option cause scroll break?

View File

@ -114,7 +114,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
### 点击 `dropdownRender` 里的内容浮层关闭怎么办?
看下 [dropdownRender 例子](#components-select-demo-custom-dropdown-menu) 里的说明
自定义内容点击时会关闭浮层,如果不喜欢关闭,可以添加 `onMouseDown={e => e.preventDefault()}` 进行阻止(更多详情见 [#13448](https://github.com/ant-design/ant-design/issues/13448)
### 自定义 Option 样式导致滚动异常怎么办?

View File

@ -110,8 +110,8 @@ class SearchTree extends React.Component {
const loop = data =>
data.map(item => {
const index = item.title.indexOf(searchValue);
const beforeStr = item.title.substr(0, index);
const afterStr = item.title.substr(index + searchValue.length);
const beforeStr = item.title.substring(0, index);
const afterStr = item.title.slice(index + searchValue.length);
const title =
index > -1 ? (
<span>

View File

@ -102,7 +102,7 @@ class PicturesWall extends React.Component {
icon = <LoadingOutlined />; // or icon = 'uploading...';
} else {
fileSufIconList.forEach(item => {
if (item.suf.includes(file.name.substr(file.name.lastIndexOf('.')))) {
if (item.suf.includes(file.name.slice(file.name.lastIndexOf('.')))) {
icon = item.type;
}
});

View File

@ -192,7 +192,7 @@ class Header extends React.Component<HeaderProps, HeaderState> {
location: { pathname, query },
} = this.props;
const currentProtocol = `${window.location.protocol}//`;
const currentHref = window.location.href.substr(currentProtocol.length);
const currentHref = window.location.href.slice(currentProtocol.length);
if (utils.isLocalStorageNameSupported()) {
localStorage.setItem('locale', utils.isZhCN(pathname) ? 'en-US' : 'zh-CN');