From b861f2f01514859e8f34399beb79b779401d93d3 Mon Sep 17 00:00:00 2001 From: Maya Barnes Date: Thu, 10 Nov 2022 17:47:23 -0800 Subject: [PATCH 1/2] Remove setAttribute & fix ReadMe typo --- README.md | 2 +- src/Handler.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8b4d0f3..235de210 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ vegaEmbed("#vis", spec, {tooltip: {theme: 'dark'}}) .catch(console.error); ``` -If you want to ue a different version of the tooltip handler, you can override the default handler with the handler from Vega Tooltip (and you need to install it separately). +If you want to use a different version of the tooltip handler, you can override the default handler with the handler from Vega Tooltip (and you need to install it separately). ```js var handler = new vegaTooltip.Handler(); diff --git a/src/Handler.ts b/src/Handler.ts index 6bda8722..aba5329f 100644 --- a/src/Handler.ts +++ b/src/Handler.ts @@ -86,6 +86,8 @@ export class Handler { this.options.offsetY ); - this.el.setAttribute('style', `top: ${y}px; left: ${x}px`); + // position the tooltip + this.el.style.top = `${y}px`; + this.el.style.left = `${x}px`; } } From e7e00760f38d4ab89049a8f87b85e2d4d50837a0 Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Fri, 18 Nov 2022 17:35:26 -0500 Subject: [PATCH 2/2] Update src/Handler.ts --- src/Handler.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Handler.ts b/src/Handler.ts index aba5329f..65be3121 100644 --- a/src/Handler.ts +++ b/src/Handler.ts @@ -86,7 +86,6 @@ export class Handler { this.options.offsetY ); - // position the tooltip this.el.style.top = `${y}px`; this.el.style.left = `${x}px`; }