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

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 #4377. Closes #4384.
  • Loading branch information
shuding authored and ThomasBurleson committed Aug 31, 2015
1 parent 1bf0802 commit 925301f
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 925301f

Please sign in to comment.