Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
chore(dropdown): add guard when closing
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleycho committed Jun 13, 2016
1 parent ba113a0 commit a68cc20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
if (openScope === dropdownScope) {
openScope = null;
$document.off('click', closeDropdown);
dropdownScope.getDropdownElement().off('keydown', this.keybindFilter);
var dropdownMenu = dropdownScope.getDropdownElement();
if (dropdownMenu) {
dropdownMenu.off('keydown', this.keybindFilter);
}
}
};

Expand Down

0 comments on commit a68cc20

Please sign in to comment.