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

Commit 925301f

Browse files
shudingThomasBurleson
authored andcommitted
fix(mdSelect): Close menu on hitting Enter key
call `checkCloseMenu(ev)` with `ev` argument. ensure references to `ev` are non-null Fixes #4377. Closes #4384.
1 parent 1bf0802 commit 925301f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/select/select.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ function SelectProvider($$interimElementProvider) {
10581058
});
10591059
ev.preventDefault();
10601060
}
1061-
checkCloseMenu();
1061+
checkCloseMenu(ev);
10621062
break;
10631063
case keyCodes.TAB:
10641064
case keyCodes.ESCAPE:
@@ -1122,7 +1122,7 @@ function SelectProvider($$interimElementProvider) {
11221122
*/
11231123
function mouseOnScrollbar() {
11241124
var clickOnScrollbar = false;
1125-
if(ev.currentTarget.children.length > 0) {
1125+
if(ev && (ev.currentTarget.children.length > 0)) {
11261126
var child = ev.currentTarget.children[0];
11271127
var hasScrollbar = child.scrollHeight > child.clientHeight;
11281128
if (hasScrollbar && child.children.length > 0) {

0 commit comments

Comments
 (0)