Skip to content

Commit

Permalink
Fixed menu component focusout bug (Fixes #247)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Oct 22, 2018
1 parent bb0b9f9 commit dcddfcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* **docs:** Document deployment process (#171)

## Bug Fixes

* **js:** Fixed menu component focusout bug (#247)

# 2.4.2

* **css:** Add blockquote component (#234)
Expand Down
3 changes: 2 additions & 1 deletion src/assets/js/protocol/protocol-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ if (typeof Mozilla === 'undefined') {
* re-queues the JavaScript to run at the end of the current excecution.
*/
setTimeout(function() {
if (!self.contains(document.activeElement)) {
// If the menu is open and the newly focused element is not a child, then call close().
if (!self.contains(document.activeElement) && self.classList.contains('is-selected')) {
Menu.close();
}
}, 0);
Expand Down

0 comments on commit dcddfcd

Please sign in to comment.