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

Commit

Permalink
Merge pull request #7419 from adobe/pflynn/fix-dropdown-focus-restore
Browse files Browse the repository at this point in the history
Fix bug #7402 (Focus not set to inline editor after creating new rule)
  • Loading branch information
njx committed Apr 5, 2014
2 parents 90bf018 + f503768 commit bf41182
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/widgets/DropdownButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,14 @@ define(function (require, exports, module) {
DropdownButton.prototype._onDropdownClose = function () {
window.document.body.removeEventListener("click", this._onClickOutside, true);
$(PanelManager).off("editorAreaResize", this.closeDropdown);

// Restore focus to old pos, unless "select" handler changed it
if (window.document.activeElement === this.$dropdown[0]) {
this._lastFocus.focus();
}

this._dropdownEventHandler = null;
this.$dropdown = null; // already remvoed from DOM automatically by PopUpManager

this._lastFocus.focus(); // restore focus to old pos
};

/** Closes the dropdown if currently open */
Expand Down

0 comments on commit bf41182

Please sign in to comment.