Skip to content

Commit

Permalink
Update SchemaFieldTypeSelect to allow passing any aria props
Browse files Browse the repository at this point in the history
- We'll specifically be using aria-labelledby in this PR, but theoretically any aria prop should be fine.
  • Loading branch information
cee-chen committed May 13, 2021
1 parent 833e13f commit 249e660
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ describe('SchemaFieldTypeSelect', () => {

expect(wrapper.find(EuiSelect).prop('disabled')).toEqual(true);
});

it('passes arbitrary props', () => {
const wrapper = shallow(<SchemaFieldTypeSelect {...props} disabled aria-label="Test label" />);

expect(wrapper.find(EuiSelect).prop('aria-label')).toEqual('Test label');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ export const SchemaFieldTypeSelect: React.FC<Props> = ({
fieldType,
updateExistingFieldType,
disabled,
...rest
}) => {
const fieldTypeOptions = Object.values(SchemaType).map((type) => ({ value: type, text: type }));
return (
<EuiSelect
{...rest}
name={fieldName}
required
value={fieldType}
Expand Down

0 comments on commit 249e660

Please sign in to comment.