From 7dd383bb1ef0175df014cd33e0a71aa568d6dd82 Mon Sep 17 00:00:00 2001 From: versecafe <147033096+versecafe@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:41:54 -0500 Subject: [PATCH] patch empty tooltip bug (#259) * patch empty tooltip bug * swap from none to tw hidden = none --- .changeset/twenty-kangaroos-agree.md | 5 +++++ packages/web/src/components/cells/hover.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/twenty-kangaroos-agree.md diff --git a/.changeset/twenty-kangaroos-agree.md b/.changeset/twenty-kangaroos-agree.md new file mode 100644 index 00000000..3190fde1 --- /dev/null +++ b/.changeset/twenty-kangaroos-agree.md @@ -0,0 +1,5 @@ +--- +'@srcbook/web': patch +--- + +fix display bug where tiny empty tooltip would appear when no quickinfo from tsserver diff --git a/packages/web/src/components/cells/hover.tsx b/packages/web/src/components/cells/hover.tsx index 55e6e361..c152aecd 100644 --- a/packages/web/src/components/cells/hover.tsx +++ b/packages/web/src/components/cells/hover.tsx @@ -35,9 +35,10 @@ export function tsHover( end: end, create: () => { const tooltipContainer = document.createElement('div'); - tooltipContainer.className = 'p-2 space-y-2 max-w-3xl max-h-96 overflow-scroll'; + tooltipContainer.className = 'hidden'; function callback({ response }: TsServerQuickInfoResponsePayloadType) { + tooltipContainer.className = 'p-2 space-y-2 max-w-3xl max-h-96 overflow-scroll'; const signatureNode = formatCode(response.displayString, theme); tooltipContainer.appendChild(signatureNode);