Skip to content

Commit

Permalink
Dispose custom hover after clicking link (#152800)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 authored Jun 22, 2022
1 parent 9024ed7 commit 70392d7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as DOM from 'vs/base/browser/dom';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { IHoverDelegate, IHoverDelegateOptions } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';
import { ITooltipMarkdownString, IUpdatableHoverOptions, setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';
import { ICustomHover, ITooltipMarkdownString, IUpdatableHoverOptions, setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';
import { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel';
import { Emitter } from 'vs/base/common/event';
import { DisposableStore } from 'vs/base/common/lifecycle';
Expand Down Expand Up @@ -153,15 +153,17 @@ export class SettingsTreeIndicatorsLabel {
},
markdownNotSupportedFallback: contentFallback
};
let hover: ICustomHover | undefined = undefined;
const options: IUpdatableHoverOptions = {
linkHandler: (scope: string) => {
onDidClickOverrideElement.fire({
targetKey: element.setting.key,
scope
});
hover!.dispose();
}
};
setupCustomHover(this.hoverDelegate, this.scopeOverridesElement, content, options);
hover = setupCustomHover(this.hoverDelegate, this.scopeOverridesElement, content, options);
}
}
this.render();
Expand Down

0 comments on commit 70392d7

Please sign in to comment.