mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
Fix fileIndex
not found TypeError (IE 11)
fileIndex is not present in IE 11 Array.prototype
This commit is contained in:
parent
0b3d7d62fa
commit
7b8a39772b
@ -3,6 +3,7 @@ import { polyfill } from 'react-lifecycles-compat';
|
||||
import RcUpload from 'rc-upload';
|
||||
import classNames from 'classnames';
|
||||
import uniqBy from 'lodash/uniqBy';
|
||||
import findIndex from 'lodash/findIndex';
|
||||
import Dragger from './Dragger';
|
||||
import UploadList from './UploadList';
|
||||
import {
|
||||
@ -73,7 +74,7 @@ class Upload extends React.Component<UploadProps, UploadState> {
|
||||
|
||||
const nextFileList = this.state.fileList.concat();
|
||||
|
||||
const fileIndex = nextFileList.findIndex(({ uid }) => uid === targetItem.uid);
|
||||
const fileIndex = findIndex(nextFileList, ({ uid }: UploadFile) => uid === targetItem.uid);
|
||||
if (fileIndex === -1) {
|
||||
nextFileList.push(targetItem);
|
||||
} else {
|
||||
|
4
typings/custom-typings.d.ts
vendored
4
typings/custom-typings.d.ts
vendored
@ -97,7 +97,9 @@ declare module 'lodash/padEnd';
|
||||
|
||||
declare module 'lodash/uniqBy';
|
||||
|
||||
declare module "raf";
|
||||
declare module 'lodash/findIndex';
|
||||
|
||||
declare module 'raf';
|
||||
|
||||
declare module 'react-lifecycles-compat';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user