From 337cacf0d253f0d45d18b53b8bbbe062096eefd8 Mon Sep 17 00:00:00 2001 From: Sergey Andrievskiy Date: Tue, 9 Jul 2019 15:10:19 +0300 Subject: [PATCH] fix(context menu): add cursor pointer to menu host (#1662) --- .../context-menu/_context-menu.component.theme.scss | 9 +++++++++ .../components/context-menu/context-menu.directive.ts | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/framework/theme/components/context-menu/_context-menu.component.theme.scss b/src/framework/theme/components/context-menu/_context-menu.component.theme.scss index 31f245b3fc..ad49108330 100644 --- a/src/framework/theme/components/context-menu/_context-menu.component.theme.scss +++ b/src/framework/theme/components/context-menu/_context-menu.component.theme.scss @@ -6,6 +6,15 @@ @import '../../styles/core/mixins'; @mixin nb-context-menu-theme() { + + .context-menu-host { + /* + Fixes click not being bubbled to the body in Safari. + https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + */ + cursor: pointer; + } + nb-context-menu { background-color: nb-theme(context-menu-background-color); border-color: nb-theme(context-menu-border-color); diff --git a/src/framework/theme/components/context-menu/context-menu.directive.ts b/src/framework/theme/components/context-menu/context-menu.directive.ts index db619e6d8f..f251024c57 100644 --- a/src/framework/theme/components/context-menu/context-menu.directive.ts +++ b/src/framework/theme/components/context-menu/context-menu.directive.ts @@ -9,6 +9,7 @@ import { ComponentRef, Directive, ElementRef, + HostBinding, Input, OnChanges, OnDestroy, @@ -105,6 +106,9 @@ import { NbMenuItem, NbMenuService } from '../menu/menu.service'; }) export class NbContextMenuDirective implements NbDynamicOverlayController, OnChanges, AfterViewInit, OnDestroy, OnInit { + @HostBinding('class.context-menu-host') + contextMenuHost = true; + /** * Position will be calculated relatively host element based on the position. * Can be top, right, bottom and left.