File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ class AjaxUploader extends Component<UploadProps> {
269
269
classNames = { } ,
270
270
disabled,
271
271
id,
272
+ name,
272
273
style,
273
274
styles = { } ,
274
275
multiple,
@@ -307,6 +308,11 @@ class AjaxUploader extends Component<UploadProps> {
307
308
< input
308
309
{ ...pickAttrs ( otherProps , { aria : true , data : true } ) }
309
310
id = { id }
311
+ /**
312
+ * https://github.com/ant-design/ant-design/issues/50643,
313
+ * https://github.com/react-component/upload/pull/575#issuecomment-2320646552
314
+ */
315
+ name = { name }
310
316
disabled = { disabled }
311
317
type = "file"
312
318
ref = { this . saveFileInput }
Original file line number Diff line number Diff line change @@ -152,6 +152,12 @@ describe('uploader', () => {
152
152
expect ( container . querySelector ( 'input' ) ! . id ) . toBe ( 'bamboo' ) ;
153
153
} ) ;
154
154
155
+ // https://github.com/ant-design/ant-design/issues/50643
156
+ it ( 'with name' , ( ) => {
157
+ const { container } = render ( < Upload name = "bamboo" /> ) ;
158
+ expect ( container . querySelector ( 'input' ) ! . name ) . toBe ( 'bamboo' ) ;
159
+ } ) ;
160
+
155
161
it ( 'should pass through data & aria attributes' , ( ) => {
156
162
const { container } = render (
157
163
< Upload
You can’t perform that action at this time.
0 commit comments