From c1f13b146d7572d49c6bb34a2e67aba1febe2ca1 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 11 Aug 2022 17:58:00 +0300 Subject: [PATCH] file field focus --- client/src/views/fields/attachment-multiple.js | 4 ++++ client/src/views/fields/file.js | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/client/src/views/fields/attachment-multiple.js b/client/src/views/fields/attachment-multiple.js index 980b65faca..22ee37958e 100644 --- a/client/src/views/fields/attachment-multiple.js +++ b/client/src/views/fields/attachment-multiple.js @@ -241,6 +241,10 @@ function (Dep, FileUpload) { }, this.events || {}); }, + focusOnInlineEdit: function () { + this.$el.find('.attach-file-label').focus(); + }, + empty: function () { this.clearIds(); diff --git a/client/src/views/fields/file.js b/client/src/views/fields/file.js index 6263c59f29..ad74cfb11b 100644 --- a/client/src/views/fields/file.js +++ b/client/src/views/fields/file.js @@ -299,6 +299,14 @@ define('views/fields/file', ['views/fields/link', 'helpers/file-upload'], functi } }, + focusOnInlineEdit: function () { + let $element = this.$el.find('.attach-file-label'); + + if ($element.length) { + $element.focus(); + } + }, + handleResize: function () { let width = this.$el.width();