TSK-1405: Fix hover selection (#3109)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-04-28 16:40:48 +07:00 committed by GitHub
parent 45bdad87b9
commit 964978b783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 6 deletions

View File

@ -89,6 +89,7 @@
class:selection={selection !== undefined ? objects[selection]?._id === object._id : false}
class:checked={checkedSet.has(object._id)}
on:mouseover={mouseAttractor(() => dispatch('obj-focus', object))}
on:mouseenter={mouseAttractor(() => dispatch('obj-focus', object))}
on:focus={() => {}}
on:contextmenu={(evt) => showMenu(evt, object)}
draggable={true}

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import { resizeObserver } from '..'
import { mouseAttractor, resizeObserver } from '..'
export let selection: number = 0
export let count: number
@ -72,7 +72,8 @@
<div
class="list-item{addClass ? ` ${addClass}` : ''}"
class:selection={row === selection}
on:mouseover={() => onRow(row)}
on:mouseover={mouseAttractor(() => onRow(row))}
on:mouseenter={mouseAttractor(() => onRow(row))}
on:focus={() => {}}
bind:this={refs[row]}
on:click={() => dispatch('click', row)}

View File

@ -15,7 +15,7 @@
<script lang="ts">
import type { Asset, IntlString } from '@hcengineering/platform'
import { createEventDispatcher } from 'svelte'
import { deviceOptionsStore, resizeObserver } from '..'
import { deviceOptionsStore, mouseAttractor, resizeObserver } from '..'
import { createFocusManager } from '../focus'
import type { AnySvelteComponent } from '../types'
import EditBox from './EditBox.svelte'
@ -151,7 +151,8 @@
class="menu-item w-full"
on:click={() => dispatch('close', item.id)}
on:focus={() => dispatch('update', item)}
on:mouseover={() => dispatch('update', item)}
on:mouseover={mouseAttractor(() => dispatch('update', item))}
on:mouseenter={mouseAttractor(() => dispatch('update', item))}
>
<div class="flex-row-center" class:mt-2={huge} class:mb-2={huge}>
{#if hasSelected}

View File

@ -34,8 +34,6 @@
id={category._id}
style:transform={category._id === tracker.issueStatusCategory.Started ? 'rotate(-90deg)' : ''}
viewBox="0 0 16 16"
stroke-width={0.75}
stroke={fill}
xmlns="http://www.w3.org/2000/svg"
>
{#if category._id === tracker.issueStatusCategory.Backlog}

View File

@ -279,6 +279,7 @@
class:fixed={row === selection}
class:selected={row === selection}
on:mouseover={mouseAttractor(() => onRow(object))}
on:mouseenter={mouseAttractor(() => onRow(object))}
on:focus={() => {}}
bind:this={refs[row]}
on:contextmenu|preventDefault={(ev) => {

View File

@ -425,6 +425,7 @@
on:contextmenu={(event) => handleMenuOpened(event, docObject)}
on:focus={() => {}}
on:mouseover={mouseAttractor(() => handleRowFocused(docObject))}
on:mouseenter={mouseAttractor(() => handleRowFocused(docObject))}
{props}
on:on-mount={() => {
wasLoaded = true