Skip to content

Commit

Permalink
feat(ui5-fileuploader): Implementing accessiblity specification (#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsanislavgatev committed May 12, 2020
1 parent 2a426dd commit 76943bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/main/src/FileUploader.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@
value-state="{{valueState}}"
placeholder="{{placeholder}}"
?disabled="{{disabled}}"
tabindex="-1"
></ui5-input>
{{/unless}}
<slot></slot>
</div>
{{#if _keepInputInShadowDOM}}
<input
type="file"
title="upload file"
title="{{titleText}}"
accept="{{accept}}"
?multiple="{{multiple}}"
?disabled="{{disabled}}"
@change="{{_onChange}}"
aria-hidden="true"
tabindex="-1"
>
{{else}}
<slot name="formSupport">
Expand Down
5 changes: 5 additions & 0 deletions packages/main/src/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from "@ui5/webcomponents-base/dist/i18nBundle.js";
import {
FILEUPLOAD_BROWSE,
FILEUPLOADER_TITLE,
} from "./generated/i18n/i18n-defaults.js";
import Input from "./Input.js";

Expand Down Expand Up @@ -305,6 +306,10 @@ class FileUploader extends UI5Element {
return this.i18nBundle.getText(FILEUPLOAD_BROWSE);
}

get titleText() {
return this.i18nBundle.getText(FILEUPLOADER_TITLE);
}

get _canUseNativeFormSupport() {
return !!this.attachInternals;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/main/src/i18n/messagebundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ DELETE=Delete

FILEUPLOAD_BROWSE=Browse...

#XACT: File uploader title
FILEUPLOADER_TITLE=Upload File

GROUP_HEADER_TEXT=Group Header

#XTXT
Expand Down

0 comments on commit 76943bc

Please sign in to comment.