mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
[CL-627] Allow menu to open above trigger without blocking trigger (#14675)
This commit is contained in:
@@ -16,11 +16,7 @@ import { filter, mergeWith } from "rxjs/operators";
|
|||||||
|
|
||||||
import { MenuComponent } from "./menu.component";
|
import { MenuComponent } from "./menu.component";
|
||||||
|
|
||||||
@Directive({
|
@Directive({ selector: "[bitMenuTriggerFor]", exportAs: "menuTrigger", standalone: true })
|
||||||
selector: "[bitMenuTriggerFor]",
|
|
||||||
exportAs: "menuTrigger",
|
|
||||||
standalone: true,
|
|
||||||
})
|
|
||||||
export class MenuTriggerForDirective implements OnDestroy {
|
export class MenuTriggerForDirective implements OnDestroy {
|
||||||
@HostBinding("attr.aria-expanded") isOpen = false;
|
@HostBinding("attr.aria-expanded") isOpen = false;
|
||||||
@HostBinding("attr.aria-haspopup") get hasPopup(): "menu" | "dialog" {
|
@HostBinding("attr.aria-haspopup") get hasPopup(): "menu" | "dialog" {
|
||||||
@@ -42,18 +38,10 @@ export class MenuTriggerForDirective implements OnDestroy {
|
|||||||
.position()
|
.position()
|
||||||
.flexibleConnectedTo(this.elementRef)
|
.flexibleConnectedTo(this.elementRef)
|
||||||
.withPositions([
|
.withPositions([
|
||||||
{
|
{ originX: "start", originY: "bottom", overlayX: "start", overlayY: "top" },
|
||||||
originX: "start",
|
{ originX: "end", originY: "bottom", overlayX: "end", overlayY: "top" },
|
||||||
originY: "bottom",
|
{ originX: "start", originY: "top", overlayX: "start", overlayY: "bottom" },
|
||||||
overlayX: "start",
|
{ originX: "end", originY: "top", overlayX: "end", overlayY: "bottom" },
|
||||||
overlayY: "top",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
originX: "end",
|
|
||||||
originY: "bottom",
|
|
||||||
overlayX: "end",
|
|
||||||
overlayY: "top",
|
|
||||||
},
|
|
||||||
])
|
])
|
||||||
.withLockedPosition(true)
|
.withLockedPosition(true)
|
||||||
.withFlexibleDimensions(false)
|
.withFlexibleDimensions(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user