File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
packages/react-core/src/components/FileUpload Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ export interface FileUploadFieldProps extends Omit<React.HTMLProps<HTMLDivElemen
37
37
hideDefaultPreview ?: boolean ;
38
38
/** Unique id for the text area. Also used to generate ids for accessible labels. */
39
39
id : string ;
40
+ /** Name property for the text input. */
41
+ name ?: string ;
40
42
/** Flag to disable the clear button. */
41
43
isClearButtonDisabled ?: boolean ;
42
44
/** Flag to show if the field is disabled. */
@@ -84,6 +86,7 @@ export interface FileUploadFieldProps extends Omit<React.HTMLProps<HTMLDivElemen
84
86
85
87
export const FileUploadField : React . FunctionComponent < FileUploadFieldProps > = ( {
86
88
id,
89
+ name,
87
90
type,
88
91
value = '' ,
89
92
filename = '' ,
@@ -135,7 +138,7 @@ export const FileUploadField: React.FunctionComponent<FileUploadFieldProps> = ({
135
138
readOnlyVariant = "default" // Always read-only regardless of isReadOnly prop (which is just for the TextArea)
136
139
isDisabled = { isDisabled }
137
140
id = { `${ id } -filename` }
138
- name = { `${ id } -filename` }
141
+ name = { name || `${ id } -filename` }
139
142
aria-label = { filenameAriaLabel }
140
143
placeholder = { filenamePlaceholder }
141
144
aria-describedby = { `${ id } -browse-button` }
@@ -172,7 +175,6 @@ export const FileUploadField: React.FunctionComponent<FileUploadFieldProps> = ({
172
175
resizeOrientation = { TextAreResizeOrientation . vertical }
173
176
validated = { validated }
174
177
id = { id }
175
- name = { id }
176
178
aria-label = { ariaLabel }
177
179
value = { value as string }
178
180
onChange = { onTextAreaChange }
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ exports[`simple fileupload 1`] = `
76
76
aria-invalid = " false"
77
77
aria-label = " File upload"
78
78
id = " simple-text-file"
79
- name = " simple-text-file"
80
79
placeholder = " "
81
80
/>
82
81
</span >
Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ exports[`simple fileuploadfield 1`] = `
74
74
aria-invalid = " false"
75
75
aria-label = " File upload"
76
76
id = " custom-file-upload"
77
- name = " custom-file-upload"
78
77
placeholder = " "
79
78
/>
80
79
</span >
You can’t perform that action at this time.
0 commit comments