attachment focus fix

This commit is contained in:
Yuri Kuznetsov
2023-01-16 09:54:21 +02:00
parent c351a8fc02
commit 6e3c765ba3
2 changed files with 17 additions and 1 deletions
+10 -1
View File
@@ -575,7 +575,16 @@ function (Dep, FileUpload) {
this.isUploading = false;
setTimeout(() => this.focusOnUploadButton(), 50);
setTimeout(() => {
if (
document.activeElement &&
document.activeElement.tagName !== 'BODY'
) {
return;
}
this.focusOnUploadButton();
}, 50);
}
})
.catch(() => {
+7
View File
@@ -604,6 +604,13 @@ define('views/fields/file', ['views/fields/link', 'helpers/file-upload'], functi
this.isUploading = false;
setTimeout(() => {
if (
document.activeElement &&
document.activeElement.tagName !== 'BODY'
) {
return;
}
let $a = this.$el.find('.preview a');
$a.focus();
}, 50);