Skip to content

Commit

Permalink
Fix TypeError warning in Hover
Browse files Browse the repository at this point in the history
  • Loading branch information
yamaton committed Sep 28, 2022
1 parent 1693b3b commit 2b75f6e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/jupyterlab-lsp/src/features/hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,13 @@ export class HoverCM extends CodeMirrorIntegration {
protected async _updateUnderlineAndTooltip(
event: MouseEvent
): Promise<boolean> {
const target = event.target as HTMLElement;
const target = event.target;

// if over an empty space in a line (and not over a token) then not worth checking
if (target.classList.contains('CodeMirror-line')) {
if (
target == null ||
(target as HTMLElement).classList.contains('CodeMirror-line')
) {
this.remove_range_highlight();
return false;
}
Expand Down

0 comments on commit 2b75f6e

Please sign in to comment.