Skip to content

Commit f355bb3

Browse files
2 parents bd67e93 + 7ae72f4 commit f355bb3

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from "@angular/core";
1+
import { Component, ElementRef } from "@angular/core";
22

33
/**
44
* The OverFlow menu component encapsulates the OverFlowMenu directive, and the menu iconography into one convienent component
@@ -18,6 +18,7 @@ import { Component } from "@angular/core";
1818
<div
1919
[ibmOverflowMenu]="options"
2020
[appendToBody]="true"
21+
[ngClass]="{'bx--overflow-menu--open': open === true}"
2122
attr.aria-label="{{'OVERFLOW_MENU.OVERFLOW' | translate}}"
2223
class="bx--overflow-menu"
2324
role="button"
@@ -35,6 +36,20 @@ import { Component } from "@angular/core";
3536
<ng-template #options>
3637
<ng-content></ng-content>
3738
</ng-template>
38-
`
39+
`,
40+
styles: [`
41+
.bx--overflow-menu--open {
42+
opacity: 1
43+
}
44+
`]
3945
})
40-
export class OverflowMenu {}
46+
export class OverflowMenu {
47+
constructor(private elementRef: ElementRef) {}
48+
49+
get open() {
50+
if (this.elementRef.nativeElement.children[0].getAttribute("aria-expanded") === "true") {
51+
return true;
52+
}
53+
return false;
54+
}
55+
}

0 commit comments

Comments
 (0)