Skip to content

Commit

Permalink
fix(mdSelect): Close menu on hitting Enter key
Browse files Browse the repository at this point in the history
call `checkCloseMenu(ev)` with `ev` argument.
ensure references to `ev` are non-null

Fixes angular#4377. Closes angular#4384.
  • Loading branch information
shuding authored and kennethcachia committed Sep 23, 2015
1 parent df944c4 commit 16afa16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ function SelectProvider($$interimElementProvider) {
});
ev.preventDefault();
}
checkCloseMenu();
checkCloseMenu(ev);
break;
case keyCodes.TAB:
case keyCodes.ESCAPE:
Expand Down Expand Up @@ -1122,7 +1122,7 @@ function SelectProvider($$interimElementProvider) {
*/
function mouseOnScrollbar() {
var clickOnScrollbar = false;
if(ev.currentTarget.children.length > 0) {
if(ev && (ev.currentTarget.children.length > 0)) {
var child = ev.currentTarget.children[0];
var hasScrollbar = child.scrollHeight > child.clientHeight;
if (hasScrollbar && child.children.length > 0) {
Expand Down

0 comments on commit 16afa16

Please sign in to comment.