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> {
269269 classNames = { } ,
270270 disabled,
271271 id,
272+ name,
272273 style,
273274 styles = { } ,
274275 multiple,
@@ -307,6 +308,11 @@ class AjaxUploader extends Component<UploadProps> {
307308 < input
308309 { ...pickAttrs ( otherProps , { aria : true , data : true } ) }
309310 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 }
310316 disabled = { disabled }
311317 type = "file"
312318 ref = { this . saveFileInput }
Original file line number Diff line number Diff line change @@ -152,6 +152,12 @@ describe('uploader', () => {
152152 expect ( container . querySelector ( 'input' ) ! . id ) . toBe ( 'bamboo' ) ;
153153 } ) ;
154154
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+
155161 it ( 'should pass through data & aria attributes' , ( ) => {
156162 const { container } = render (
157163 < Upload
You can’t perform that action at this time.
0 commit comments