MDL-68344 filepicker: File Picker focus lost on upload

This commit is contained in:
Thong Bui 2020-04-06 12:02:43 +07:00 committed by Thong Bui
parent 99777d963f
commit fb75fd0396
2 changed files with 4 additions and 1 deletions

View File

@ -493,6 +493,7 @@ M.form_filemanager.init = function(Y, options) {
// XXX: magic here, to let filepicker use filemanager scope
options.magicscope = this;
options.savepath = this.currentpath;
options.previousActiveElement = e.target.ancestor('a', true);
M.core_filepicker.show(Y, options);
},

View File

@ -1422,7 +1422,9 @@ M.core_filepicker.init = function(Y, options) {
width : width+'px',
responsiveWidth : 768,
height : '558px',
zIndex : this.options.zIndex
zIndex : this.options.zIndex,
focusOnPreviousTargetAfterHide: true,
focusAfterHide: this.options.previousActiveElement
});
// create panel for selecting a file (initially hidden)