diff --git a/packages/presentation/src/components/DocPopup.svelte b/packages/presentation/src/components/DocPopup.svelte index b99e17d6fe..ccdea5009b 100644 --- a/packages/presentation/src/components/DocPopup.svelte +++ b/packages/presentation/src/components/DocPopup.svelte @@ -24,7 +24,6 @@ IconCheck, IconSearch, ListView, - closeTooltip, createFocusManager, deviceOptionsStore, resizeObserver, @@ -142,43 +141,6 @@ return obj } - let selectedDiv: HTMLElement | undefined - let scrollDiv: HTMLElement | undefined - let cHeight = 0 - let timer: any = null - - const updateLocation = (scrollDiv?: HTMLElement, selectedDiv?: HTMLElement, objects?: Doc[], selected?: Ref) => { - const objIt = objects?.find((it) => it._id === selected) - if (objIt === undefined) { - cHeight = 0 - return - } - if (scrollDiv && selectedDiv) { - const r = selectedDiv.getBoundingClientRect() - const r2 = scrollDiv.getBoundingClientRect() - if (r && r2) { - if (r.top > r2.top && r.bottom < r2.bottom) { - cHeight = 0 - } else { - if (r.bottom < r2.bottom) { - cHeight = 1 - } else { - cHeight = -1 - } - } - } - } - if (!timer) { - timer = setTimeout(() => { - closeTooltip() - clearTimeout(timer) - timer = null - }, 50) - } - } - - $: updateLocation(scrollDiv, selectedDiv, objects, selected) - const forbiddenDeselectItemIds = new Set(disallowDeselect) function getGroup (doc: Doc, groupBy: any): any { @@ -226,10 +188,7 @@ {/if} - {#if cHeight === 1} -
- {/if} -
updateLocation(scrollDiv, selectedDiv, objects, selected)} bind:this={scrollDiv}> +
@@ -260,7 +219,7 @@ {#if (allowDeselect && selected) || multiSelect || selected}
{#if obj._id === selected || selectedElements.has(obj._id)} -
+
{/if} @@ -271,9 +230,6 @@
- {#if cHeight === -1} -
- {/if} diff --git a/packages/theme/styles/popups.scss b/packages/theme/styles/popups.scss index ce363e0cc8..8e875de22e 100644 --- a/packages/theme/styles/popups.scss +++ b/packages/theme/styles/popups.scss @@ -194,10 +194,6 @@ &.show + .menu-group { height: auto; } } } - .whereSelected { - height: 2px; - background-color: var(--theme-caret-color); - } .menu-space { flex-shrink: 0; height: .5rem; diff --git a/packages/ui/src/components/SelectPopup.svelte b/packages/ui/src/components/SelectPopup.svelte index ed7b83477d..20ddf2c709 100644 --- a/packages/ui/src/components/SelectPopup.svelte +++ b/packages/ui/src/components/SelectPopup.svelte @@ -82,35 +82,6 @@ $: filteredObjects = value.filter((el) => (el.label ?? el.text ?? '').toLowerCase().includes(search.toLowerCase())) $: huge = size === 'medium' || size === 'large' - - let selectedDiv: HTMLElement | undefined - let scrollDiv: HTMLElement | undefined - let cHeight = 0 - - const updateLocation = (scrollDiv?: HTMLElement, selectedDiv?: HTMLElement, objects?: ValueType[]) => { - const objIt = objects?.find((it) => it.isSelected) - if (objIt === undefined) { - cHeight = 0 - return - } - if (scrollDiv && selectedDiv) { - const r = selectedDiv.getBoundingClientRect() - const r2 = scrollDiv.getBoundingClientRect() - if (r && r2) { - if (r.top > r2.top && r.bottom < r2.bottom) { - cHeight = 0 - } else { - if (r.bottom < r2.bottom) { - cHeight = 1 - } else { - cHeight = -1 - } - } - } - } - } - - $: updateLocation(scrollDiv, selectedDiv, filteredObjects) @@ -140,10 +111,7 @@ {:else}