Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit bf41182

Browse files
author
Narciso Jaramillo
committed
Merge pull request #7419 from adobe/pflynn/fix-dropdown-focus-restore
Fix bug #7402 (Focus not set to inline editor after creating new rule)
2 parents 90bf018 + f503768 commit bf41182

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/widgets/DropdownButton.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,14 @@ define(function (require, exports, module) {
188188
DropdownButton.prototype._onDropdownClose = function () {
189189
window.document.body.removeEventListener("click", this._onClickOutside, true);
190190
$(PanelManager).off("editorAreaResize", this.closeDropdown);
191+
192+
// Restore focus to old pos, unless "select" handler changed it
193+
if (window.document.activeElement === this.$dropdown[0]) {
194+
this._lastFocus.focus();
195+
}
196+
191197
this._dropdownEventHandler = null;
192198
this.$dropdown = null; // already remvoed from DOM automatically by PopUpManager
193-
194-
this._lastFocus.focus(); // restore focus to old pos
195199
};
196200

197201
/** Closes the dropdown if currently open */

0 commit comments

Comments
 (0)