Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `aria-describedby` to EuiFilePicker ([#2919](https://github.com/elastic/eui/pull/2919))
Comment thread
anishagg17 marked this conversation as resolved.
Outdated
- Converted `EuiComboBox`, `EuiComboBoxInput`, `EuiComboBoxPill`, `EuiComboBoxOptionsList`, `EuiComboBoxOption`, and `EuiComboBoxTitle` to TypeScript ([#2838](https://github.com/elastic/eui/pull/2838))
Comment thread
anishagg17 marked this conversation as resolved.
- Converted `EuiCodeEditor` to TypeScript ([#2836](https://github.com/elastic/eui/pull/2836))
- Converted `EuiCode` and `EuiCodeBlock` and to TypeScript ([#2835](https://github.com/elastic/eui/pull/2835))
Expand Down
1 change: 1 addition & 0 deletions src-docs/src/views/form_controls/file_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class FilePicker extends Component {
]}>
<EuiFilePicker
id="asdf2"
aUniqueId="xzst21343"
multiple
initialPromptText="Select or drag and drop multiple files"
onChange={files => {
Expand Down
12 changes: 11 additions & 1 deletion src/components/form/file_picker/file_picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { EuiProgress } from '../../progress';
import { EuiIcon } from '../../icon';
import { EuiI18n } from '../../i18n';
import { EuiLoadingSpinner } from '../../loading';
import { htmlIdGenerator } from '../../../services/accessibility/html_id_generator';

const displayToClassNameMap = {
default: null,
Expand Down Expand Up @@ -47,6 +48,7 @@ export interface EuiFilePickerProps
isInvalid?: boolean;
isLoading?: boolean;
disabled?: boolean;
aUniqueId?: string;
Comment thread
anishagg17 marked this conversation as resolved.
Outdated
}

export class EuiFilePicker extends Component<EuiFilePickerProps> {
Expand Down Expand Up @@ -118,6 +120,7 @@ export class EuiFilePicker extends Component<EuiFilePickerProps> {
initialPromptText,
className,
disabled,
aUniqueId,
compressed,
onChange,
isInvalid,
Expand All @@ -127,6 +130,12 @@ export class EuiFilePicker extends Component<EuiFilePickerProps> {
...rest
} = this.props;

let UniqueId: string = htmlIdGenerator().toString();
Comment thread
anishagg17 marked this conversation as resolved.
Outdated

if (aUniqueId) {
UniqueId = `${aUniqueId}-filePicker__prompt`;
}

const isOverridingInitialPrompt = this.state.promptText != null;

const normalFormControl = display === 'default';
Expand Down Expand Up @@ -199,9 +208,10 @@ export class EuiFilePicker extends Component<EuiFilePickerProps> {
onDrop={this.hideDrop}
disabled={disabled}
{...rest}
aria-describedby={UniqueId}
Comment thread
anishagg17 marked this conversation as resolved.
Outdated
/>
</EuiValidatableControl>
<div className="euiFilePicker__prompt">
<div className="euiFilePicker__prompt" id={UniqueId}>
<EuiIcon
className="euiFilePicker__icon"
type="importAction"
Expand Down