Skip to content

Commit 9b41c4f

Browse files
fix(FileUpload): hid input of type file from AT (#11438)
* fix(FileUpload): hid input of type file from AT * Updated snapshots * Hid input in CodeEditor * Updated codeeditor snapshot
1 parent f643fca commit 9b41c4f

File tree

6 files changed

+8
-1
lines changed

6 files changed

+8
-1
lines changed

packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
680680
{editorHeader}
681681
<div className={css(styles.codeEditorMain, isDragActive && styles.modifiers.dragHover)}>
682682
<div className={css(styles.codeEditorUpload)}>
683-
<input {...getInputProps()} /* hidden, necessary for react-dropzone */ />
683+
<input {...getInputProps()} /* hidden, necessary for react-dropzone */ hidden />
684684
{(showEmptyState || providedEmptyState) && !value ? emptyState : editor}
685685
</div>
686686
</div>

packages/react-code-editor/src/components/CodeEditor/__test__/__snapshots__/CodeEditor.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ exports[`Matches snapshot with control buttons enabled 1`] = `
119119
class="pf-v6-c-code-editor__upload"
120120
>
121121
<input
122+
hidden=""
122123
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(50%); height: 1px; margin: 0px -1px -1px 0px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap;"
123124
tabindex="-1"
124125
type="file"

packages/react-core/src/components/FileUpload/FileUpload.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ export const FileUpload: React.FunctionComponent<FileUploadProps> = ({
179179
<input
180180
/* hidden, necessary for react-dropzone */
181181
{...inputProps}
182+
hidden
182183
/>
183184
{children}
184185
</FileUploadField>

packages/react-core/src/components/FileUpload/__tests__/__snapshots__/FileUpload.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ exports[`simple fileupload 1`] = `
8585
</span>
8686
</div>
8787
<input
88+
hidden=""
8889
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(50%); height: 1px; margin: 0px -1px -1px 0px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap;"
8990
tabindex="-1"
9091
type="file"

packages/react-core/src/components/MultipleFileUpload/MultipleFileUpload.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const MultipleFileUpload: React.FunctionComponent<MultipleFileUploadProps
6666
<input
6767
/* hidden, necessary for react-dropzone */
6868
{...getInputProps()}
69+
hidden
6970
/>
7071
{children}
7172
</div>

packages/react-core/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUpload.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ exports[`MultipleFileUpload renders custom class names 1`] = `
88
tabindex="0"
99
>
1010
<input
11+
hidden=""
1112
multiple=""
1213
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(50%); height: 1px; margin: 0px -1px -1px 0px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap;"
1314
tabindex="-1"
@@ -26,6 +27,7 @@ exports[`MultipleFileUpload renders with expected class names when horizontal 1`
2627
tabindex="0"
2728
>
2829
<input
30+
hidden=""
2931
multiple=""
3032
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(50%); height: 1px; margin: 0px -1px -1px 0px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap;"
3133
tabindex="-1"
@@ -44,6 +46,7 @@ exports[`MultipleFileUpload renders with expected class names when not horizonta
4446
tabindex="0"
4547
>
4648
<input
49+
hidden=""
4750
multiple=""
4851
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(50%); height: 1px; margin: 0px -1px -1px 0px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap;"
4952
tabindex="-1"

0 commit comments

Comments
 (0)