Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:Press Tab twice to focus on the upload button #520

Closed
wants to merge 4 commits into from
Closed
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
1 change: 0 additions & 1 deletion src/AjaxUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ class AjaxUploader extends Component<UploadProps> {
onMouseLeave,
onDrop: this.onFileDrop,
onDragOver: this.onFileDrop,
tabIndex: '0',
};
return (
<Tag {...events} className={cls} role="button" style={style}>
Expand Down
5 changes: 5 additions & 0 deletions tests/uploader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,4 +865,9 @@ describe('uploader', () => {
expect(wrapper.find('.bamboo-input').props().style.color).toEqual('red');
expect(wrapper.find('input').props().style.display).toBe('none');
});

it('the upload button wrapper span does not have the tabIndex attribute', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test case here should verify the number of times to focus.

const wrapper = mount(<Uploader />);
expect(wrapper.find('.rc-upload').props().tabIndex).toBe(undefined);
});
});