enh(a11y): Always visible file rename label

Signed-off-by: Christopher Ng <chrng8@gmail.com>
pull/40084/head
Christopher Ng 2023-08-28 12:35:37 +07:00
parent ffe29518e8
commit e9fd37507f
1 changed files with 9 additions and 1 deletions

@ -70,7 +70,7 @@
class="files-list__row-rename"
@submit.prevent.stop="onRename">
<NcTextField ref="renameInput"
:aria-label="t('files', 'File name')"
:label="renameLabel"
:autofocus="true"
:minlength="1"
:required="true"
@ -479,6 +479,14 @@ export default Vue.extend({
return this.source.attributes.favorite === 1
},
renameLabel() {
const matchLabel: Record<FileType, string> = {
[FileType.File]: t('files', 'File name'),
[FileType.Folder]: t('files', 'Folder name'),
}
return matchLabel[this.source.type]
},
isRenaming() {
return this.renamingStore.renamingNode === this.source
},