Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Inputs/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ export const TextInput: FC<TextInputProps> = React.forwardRef(
const ariaInvalid = ariaInvalidProp || mergedStatus === 'error';
const ariaDescribedBy =
mergedStatus === 'error'
? ariaDescribedByProp || errorMessageId
: undefined;
? [ariaDescribedByProp, errorMessageId].filter(Boolean).join(' ')
: ariaDescribedByProp;

// Needed for form error scroll-into-view by id
const mergedFormItemInput: boolean = isFormItemInput || formItemInput;
Expand Down
11 changes: 10 additions & 1 deletion src/components/Upload/Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (
accept = '',
acceptedFileTypesText: defaultAcceptedFileTypesText,
action = '',
'aria-describedby': ariaDescribedBy,
'aria-labelledby': ariaLabelledBy,
children,
classNames,
configContextProps = {
Expand Down Expand Up @@ -577,6 +579,8 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (
);
const renderButton = (): JSX.Element => (
<Button
aria-describedby={ariaDescribedBy}
aria-labelledby={ariaLabelledBy}
classNames={styles.uploadDropButton}
configContextProps={configContextProps}
disabled={mergedDisabled}
Expand Down Expand Up @@ -699,7 +703,12 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (
const renderUploadButton = (
uploadButtonStyle?: React.CSSProperties
): JSX.Element => (
<div className={uploadButtonClassNames} style={uploadButtonStyle}>
<div
aria-describedby={ariaDescribedBy}
aria-labelledby={ariaLabelledBy}
className={uploadButtonClassNames}
style={uploadButtonStyle}
>
<OcUpload {...ocUploadProps} ref={upload} />
</div>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/Upload/Upload.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ export interface UploadProps<T = any> extends Pick<OcUploadProps, 'capture'> {
* Upload URL
*/
action?: Action;

'aria-describedby'?: string;

'aria-labelledby'?: string;
/**
* Hook executed before uploading.
* Uploading will be stopped with false or a rejected Promise returned.
Expand Down