Skip to content

Commit 8439b9a

Browse files
authored
Merge branch 'master' into issue-163-light-style-input
2 parents 9593abd + 115f678 commit 8439b9a

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/dialog/overflow-menu/overflow-menu-pane.component.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import { I18n } from "./../../i18n/i18n.module";
1919
#dialog
2020
class="bx--overflow-menu-options bx--overflow-menu-options--open"
2121
role="menu"
22-
(focusout)="clickClose($event)"
22+
(focusout)="menuClose($event)"
23+
(click)="doClose()"
2324
[attr.aria-label]="dialogConfig.menuLabel">
2425
<ng-template
2526
[ngTemplateOutlet]="dialogConfig.content"
@@ -110,14 +111,10 @@ export class OverflowMenuPane extends Dialog {
110111
}
111112
}
112113

113-
clickClose(event) {
114-
// Opens menu when clicking on the menu button and stays open while navigating through the options
115-
if (this.dialogConfig.parentRef.nativeElement.firstChild.contains(event.target) ||
116-
this.listItems().some(button => button === event.relatedTarget) ||
117-
event.type === "focusout" && event.relatedTarget === this.dialogConfig.parentRef.nativeElement) {
118-
return;
114+
menuClose(event) {
115+
if (this.listItems().some(button => button === document.activeElement)) {
116+
this.doClose();
119117
}
120-
this.doClose();
121118
}
122119

123120
protected listItems() {

src/dialog/tooltip/tooltip.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { withNotes } from "@storybook/addon-notes";
33
import { action } from "@storybook/addon-actions";
44
import { withKnobs, boolean, object } from "@storybook/addon-knobs/angular";
55

6-
import { DialogModule } from "../../";
6+
import { DialogModule, PlaceholderModule } from "../../";
77

88
storiesOf("Tooltip", module)
99
.addDecorator(
1010
moduleMetadata({
1111
imports: [
12-
DialogModule
12+
DialogModule, PlaceholderModule
1313
]
1414
})
1515
)

0 commit comments

Comments
 (0)