diff --git a/apps/files/src/components/FileUpload.vue b/apps/files/src/components/FileUpload.vue index 5e2bfc68d4e..ea7ac3f719c 100644 --- a/apps/files/src/components/FileUpload.vue +++ b/apps/files/src/components/FileUpload.vue @@ -2,7 +2,7 @@ Upload File
- +
diff --git a/apps/files/src/components/FilesApp.vue b/apps/files/src/components/FilesApp.vue index 05078e29357..d23be09390b 100644 --- a/apps/files/src/components/FilesApp.vue +++ b/apps/files/src/components/FilesApp.vue @@ -3,7 +3,7 @@ -
+
@@ -142,7 +142,11 @@ export default { this.renameDialogErrorMessage = this.validateFileName(value) } }, - + created () { + this.$root.$on('upload-end', () => { + this.delayForScreenreader(() => this.$refs.filesListWrapper.focus()) + }) + }, computed: { ...mapGetters('Files', [ 'selectedFiles', 'activeFiles', 'dropzone', 'loadingFolder', 'highlightedFile', 'currentFolder', 'inProgress', diff --git a/apps/files/src/components/UploadProgress.vue b/apps/files/src/components/UploadProgress.vue index 20ff2d8b0e2..d8f930b1015 100644 --- a/apps/files/src/components/UploadProgress.vue +++ b/apps/files/src/components/UploadProgress.vue @@ -10,6 +10,7 @@ icon="expand_more" /> @@ -21,13 +22,16 @@ class="uk-width-1-1 uk-width-medium@s" > {{ totalUploadProgress | roundNumber}} % + { + this.$nextTick(() => { + this.delayForScreenreader(() => this.$refs.progressbar.$el.focus()) + }) + }) + }, computed: { ...mapGetters('Files', ['inProgress', 'uploaded']), @@ -82,6 +96,13 @@ export default { return progressTotal } + }, + watch: { + totalUploadProgress (value) { + if (value === 100) { + this.announcement = this.announcementOnComplete + } + } } } diff --git a/apps/files/src/mixins.js b/apps/files/src/mixins.js index d2fc2517364..19c4eea29f6 100644 --- a/apps/files/src/mixins.js +++ b/apps/files/src/mixins.js @@ -45,6 +45,12 @@ export default { formDateFromNow (date) { return moment(date).locale(this.$language.current).fromNow() }, + delayForScreenreader (func, delay = 500) { + /* + * Delay for screen readers Virtual buffers + */ + setTimeout(() => func(), delay) + }, fileTypeIcon (file) { if (file) { if (file.type === 'folder') { @@ -287,6 +293,7 @@ export default { }, $_ocUpload (file, path, overwrite = null, emitSuccess = true, addToProgress = true) { + this.$root.$emit('upload-start') let basePath = this.path || '' let relativePath = path if (addToProgress) { @@ -318,6 +325,7 @@ export default { } promise.then(e => { + this.$root.$emit('upload-end') this.removeFileFromProgress(file) if (emitSuccess) { this.$emit('success', e, file)