@@ -204,7 +204,11 @@ const AjaxUploader: React.FC<Readonly<React.PropsWithChildren<UploadProps>>> = p
204
204
props . onBatchStart ?.(
205
205
fileList . map ( ( { origin, parsedFile } ) => ( { file : origin , parsedFile } ) ) ,
206
206
) ;
207
- fileList . filter ( file => file . parsedFile !== null ) . forEach ( file => post ( file ) ) ;
207
+ fileList
208
+ . filter ( file => file . parsedFile !== null )
209
+ . forEach ( file => {
210
+ post ( file ) ;
211
+ } ) ;
208
212
} ) ;
209
213
} ;
210
214
@@ -259,14 +263,8 @@ const AjaxUploader: React.FC<Readonly<React.PropsWithChildren<UploadProps>>> = p
259
263
}
260
264
} ;
261
265
262
- const cls = classnames ( prefixCls , className , {
263
- [ `${ prefixCls } -disabled` ] : disabled ,
264
- } ) ;
265
-
266
266
// because input don't have directory/webkitdirectory type declaration
267
- const dirProps : any = directory
268
- ? { directory : 'directory' , webkitdirectory : 'webkitdirectory' }
269
- : { } ;
267
+ const dirProps = directory ? { directory : 'directory' , webkitdirectory : 'webkitdirectory' } : { } ;
270
268
271
269
const events = disabled
272
270
? { }
@@ -277,11 +275,18 @@ const AjaxUploader: React.FC<Readonly<React.PropsWithChildren<UploadProps>>> = p
277
275
onMouseLeave,
278
276
onDrop : onFileDrop ,
279
277
onDragOver : onFileDrop ,
280
- tabIndex : hasControlInside ? undefined : 0 ,
281
278
} ;
282
279
283
280
return (
284
- < Tag { ...events } className = { cls } role = { hasControlInside ? undefined : 'button' } style = { style } >
281
+ < Tag
282
+ { ...events }
283
+ style = { style }
284
+ role = { disabled || hasControlInside ? undefined : 'button' }
285
+ tabIndex = { disabled || hasControlInside ? undefined : 0 }
286
+ className = { classnames ( prefixCls , className , {
287
+ [ `${ prefixCls } -disabled` ] : disabled ,
288
+ } ) }
289
+ >
285
290
< input
286
291
{ ...pickAttrs ( otherProps , { aria : true , data : true } ) }
287
292
id = { id }
@@ -308,4 +313,8 @@ const AjaxUploader: React.FC<Readonly<React.PropsWithChildren<UploadProps>>> = p
308
313
) ;
309
314
} ;
310
315
316
+ if ( process . env . NODE_ENV !== 'production' ) {
317
+ AjaxUploader . displayName = 'AjaxUploader' ;
318
+ }
319
+
311
320
export default AjaxUploader ;
0 commit comments