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(ui5-upload-collection): add region and roledescription to root el… #2915

Merged
merged 1 commit into from
Mar 9, 2021
Merged
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
6 changes: 5 additions & 1 deletion packages/fiori/src/UploadCollection.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div class="ui5-uc-root" @drop="{{_ondrop}}">
<div
class="ui5-uc-root"
role="region"
aria-roledescription="{{_roleDescription}}"
@drop="{{_ondrop}}">
<div class="ui5-uc-header">
<slot name="header"></slot>
</div>
Expand Down
5 changes: 5 additions & 0 deletions packages/fiori/src/UploadCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
UPLOADCOLLECTION_NO_DATA_DESCRIPTION,
UPLOADCOLLECTION_DRAG_FILE_INDICATOR,
UPLOADCOLLECTION_DROP_FILE_INDICATOR,
UPLOADCOLLECTION_ARIA_ROLE_DESCRIPTION,
} from "./generated/i18n/i18n-defaults.js";
import {
attachBodyDnDHandler,
Expand Down Expand Up @@ -331,6 +332,10 @@ class UploadCollection extends UI5Element {
return this.noDataDescription || this.i18nBundle.getText(UPLOADCOLLECTION_NO_DATA_DESCRIPTION);
}

get _roleDescription() {
return this.i18nBundle.getText(UPLOADCOLLECTION_ARIA_ROLE_DESCRIPTION);
}

get _dndOverlayText() {
if (this._dndOverlayMode === UploadCollectionDnDOverlayMode.Drag) {
return this.i18nBundle.getText(UPLOADCOLLECTION_DRAG_FILE_INDICATOR);
Expand Down
3 changes: 3 additions & 0 deletions packages/fiori/src/i18n/messagebundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ UPLOADCOLLECTION_NO_DATA_TEXT=No files found.
#XMSG: Message text for no data description in the UploadCollection
UPLOADCOLLECTION_NO_DATA_DESCRIPTION=Drop files to upload, or use the Upload button.

#XACT: ARIA announcement for the ettribute 'aria-roledescription' of the UploadCollection component
UPLOADCOLLECTION_ARIA_ROLE_DESCRIPTION=Upload collection

#XMSG: Message text indicating where to drag
UPLOADCOLLECTION_DRAG_FILE_INDICATOR=Drag files here

Expand Down