Skip to content

Commit

Permalink
MDL-68344 filepicker: File Picker focus lost on upload
Browse files Browse the repository at this point in the history
  • Loading branch information
JBThong authored and Thong Bui committed Sep 4, 2020
1 parent 99777d9 commit fb75fd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/form/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

Expand Down
4 changes: 3 additions & 1 deletion repository/filepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fb75fd0

Please sign in to comment.