fix the menu not hide issue (#15138)

This commit is contained in:
Alan Ren
2021-04-14 16:18:45 -07:00
committed by GitHub
parent 3a1885491f
commit 4edbd6f3e7
2 changed files with 2 additions and 4 deletions

View File

@@ -60,7 +60,7 @@ export class HeaderFilter<T extends Slick.SlickData> {
.subscribe(this.grid.onKeyDown, (e: DOMEvent) => this.handleKeyDown(e as KeyboardEvent));
this.grid.setColumns(this.grid.getColumns());
this.disposableStore.add(addDisposableListener(document.body, 'mousedown', e => this.handleBodyMouseDown(e)));
this.disposableStore.add(addDisposableListener(document.body, 'mousedown', e => this.handleBodyMouseDown(e), true));
this.disposableStore.add(addDisposableListener(document.body, 'keydown', e => this.handleKeyDown(e)));
}
@@ -80,8 +80,6 @@ export class HeaderFilter<T extends Slick.SlickData> {
private handleBodyMouseDown(e: MouseEvent): void {
if (this.$menu && this.$menu[0] !== e.target && !jQuery.contains(this.$menu[0], e.target as Element)) {
this.hideMenu();
e.preventDefault();
e.stopPropagation();
}
}

View File

@@ -528,7 +528,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
}));
if (this.enableFilteringFeature) {
this.filterPlugin = new HeaderFilter(this.contextViewService);
attachTableFilterStyler(this.filterPlugin, this.themeService);
this._register(attachTableFilterStyler(this.filterPlugin, this.themeService));
this.table.registerPlugin(this.filterPlugin);
}
if (this.styles) {