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

feat: announce file upload events #3389

Merged
merged 2 commits into from
Feb 3, 2022
Merged

Conversation

tomivirkki
Copy link
Member

@tomivirkki tomivirkki commented Feb 3, 2022

Fixes #3365

This PR makes the <vaadin-upload> component announce on the following file upload events

  • upload-start
  • upload-success
  • file-reject
  • upload-error

When the events occur, focus doesn't leave the "upload files" button but instead, an alert is created using the internal a11y-announcer helper. The PR also adds support for mode: 'alert' to a11y-announcer.

Testing tip: the upload dev page has a radio group for switching the outcome of a manual file upload.

@tomivirkki tomivirkki added the a11y Accessibility issue label Feb 3, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Comment on lines +181 to +184
expect(scrollTarget.getBoundingClientRect().bottom).to.be.within(
Math.round(itemRect.top),
Math.round(itemRect.bottom)
);
Copy link
Member Author

Choose a reason for hiding this comment

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

Not related to the change, but these tests have started failing (on master) due to some sub-pixel rendering change.

Copy link
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

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

LGTM. Let's change from chore: to something else, maybe fix: or feat:

@tomivirkki tomivirkki changed the title chore: announce file upload events feat: announce file upload events Feb 3, 2022
@tomivirkki tomivirkki merged commit 529cad5 into master Feb 3, 2022
@tomivirkki tomivirkki deleted the upload-file-announcements branch February 3, 2022 12:40
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 23.0.0.beta2 and is also targeting the upcoming stable 23.0.0 version.

@tomivirkki tomivirkki mentioned this pull request Aug 9, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[upload] Announce state of the uploaded item
3 participants