Skip to content

Commit

Permalink
fix(FileUploader): remove invalid default role value
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Oct 4, 2019
1 parent 73f7bde commit c916b74
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const props = {
','
),
disabled: boolean('Disabled (disabled)', false),
role: text('ARIA role of the button (role)', ''),
tabIndex: number('Tab index (tabIndex)', 0),
onChange: action('onChange'),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ describe('FileUploaderButton', () => {
expect(wrapper.find('input').prop('disabled')).toEqual(true);
});

it('does have default role', () => {
expect(mountWrapper.props().role).toBeTruthy();
});

it('resets the input value onClick', () => {
const input = mountWrapper.find(`.${prefix}--visually-hidden`);
input.instance().value = '';
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/FileUploader/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export class FileUploaderButton extends Component {
onClick: () => {},
accept: [],
disabled: false,
role: 'button',
};

static getDerivedStateFromProps({ labelText }, state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function FileUploaderDropContainer(props) {
<label
className={labelClasses}
htmlFor={id || uid.current}
role={role || 'button'}
role={role}
tabIndex={tabIndex || 0}
onKeyDown={evt => {
if (matches(evt, [keys.Enter, keys.Space])) {
Expand Down

0 comments on commit c916b74

Please sign in to comment.