From 19ed49a32f81610170452ddadacbfff86f4dd2c7 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Thu, 8 Jun 2023 17:29:42 +0700 Subject: [PATCH] UBER-425: Tooltup/popup fixes (#3404) Signed-off-by: Andrey Sobolev --- .../src/components/ReferenceInput.svelte | 4 ++- .../ui/src/components/TooltipInstance.svelte | 34 +++++++++++++++++-- packages/ui/src/tooltips.ts | 16 +++++++-- packages/ui/src/types.ts | 2 +- .../src/components/AttachmentRefInput.svelte | 2 ++ .../src/components/CommentInput.svelte | 2 ++ .../src/components/CommentPopup.svelte | 22 ++++++++++-- 7 files changed, 72 insertions(+), 10 deletions(-) diff --git a/packages/text-editor/src/components/ReferenceInput.svelte b/packages/text-editor/src/components/ReferenceInput.svelte index 19415734b9..842d0f8fcb 100644 --- a/packages/text-editor/src/components/ReferenceInput.svelte +++ b/packages/text-editor/src/components/ReferenceInput.svelte @@ -344,12 +344,14 @@ textEditor.clear() } }} - on:on:blur={() => { + on:blur={() => { focused = false + dispatch('blur', focused) }} on:focus={() => { focused = true updateFocus() + dispatch('focus', focused) }} extensions={[completionPlugin]} on:selection-update={updateFormattingState} diff --git a/packages/ui/src/components/TooltipInstance.svelte b/packages/ui/src/components/TooltipInstance.svelte index be12b16396..6c2f219517 100644 --- a/packages/ui/src/components/TooltipInstance.svelte +++ b/packages/ui/src/components/TooltipInstance.svelte @@ -161,7 +161,9 @@ const inPopup: boolean = ev.x >= rectP.left && ev.x <= rectP.right && ev.y >= rectP.top - dT && ev.y <= rectP.bottom + dB - if ((tooltipSW && !inTrigger) || !(inTrigger || inPopup)) hideTooltip() + if ($tooltip.kind !== 'popup') { + if ((tooltipSW && !inTrigger) || !(inTrigger || inPopup)) hideTooltip() + } } } @@ -170,15 +172,27 @@ onDestroy(() => hideTooltip()) +{#if $tooltip.kind === 'popup'} +