Skip to content

Commit 6db9f09

Browse files
authored
fix(ui5-upload-collection): add region and roledescription to root element (#2915)
1 parent 92691b2 commit 6db9f09

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

packages/fiori/src/UploadCollection.hbs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<div class="ui5-uc-root" @drop="{{_ondrop}}">
1+
<div
2+
class="ui5-uc-root"
3+
role="region"
4+
aria-roledescription="{{_roleDescription}}"
5+
@drop="{{_ondrop}}">
26
<div class="ui5-uc-header">
37
<slot name="header"></slot>
48
</div>

packages/fiori/src/UploadCollection.js

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
UPLOADCOLLECTION_NO_DATA_DESCRIPTION,
1414
UPLOADCOLLECTION_DRAG_FILE_INDICATOR,
1515
UPLOADCOLLECTION_DROP_FILE_INDICATOR,
16+
UPLOADCOLLECTION_ARIA_ROLE_DESCRIPTION,
1617
} from "./generated/i18n/i18n-defaults.js";
1718
import {
1819
attachBodyDnDHandler,
@@ -331,6 +332,10 @@ class UploadCollection extends UI5Element {
331332
return this.noDataDescription || this.i18nBundle.getText(UPLOADCOLLECTION_NO_DATA_DESCRIPTION);
332333
}
333334

335+
get _roleDescription() {
336+
return this.i18nBundle.getText(UPLOADCOLLECTION_ARIA_ROLE_DESCRIPTION);
337+
}
338+
334339
get _dndOverlayText() {
335340
if (this._dndOverlayMode === UploadCollectionDnDOverlayMode.Drag) {
336341
return this.i18nBundle.getText(UPLOADCOLLECTION_DRAG_FILE_INDICATOR);

packages/fiori/src/i18n/messagebundle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ UPLOADCOLLECTION_NO_DATA_TEXT=No files found.
9696
#XMSG: Message text for no data description in the UploadCollection
9797
UPLOADCOLLECTION_NO_DATA_DESCRIPTION=Drop files to upload, or use the Upload button.
9898

99+
#XACT: ARIA announcement for the ettribute 'aria-roledescription' of the UploadCollection component
100+
UPLOADCOLLECTION_ARIA_ROLE_DESCRIPTION=Upload collection
101+
99102
#XMSG: Message text indicating where to drag
100103
UPLOADCOLLECTION_DRAG_FILE_INDICATOR=Drag files here
101104

0 commit comments

Comments
 (0)