Fixed the mouse pointer over the Avatar (#9000)

This commit is contained in:
Alexander Platov 2025-05-21 08:23:03 +07:00 committed by GitHub
parent 9b42d2e87d
commit 5f63ee7a99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 39 deletions

View File

@ -320,7 +320,8 @@ input.search {
.flex-presenter, .inline-presenter { .flex-presenter, .inline-presenter {
flex-wrap: nowrap; flex-wrap: nowrap;
min-width: 0; min-width: 0;
cursor: pointer;
&:not(.no-pointer) { cursor: pointer; }
.icon { .icon {
color: var(--theme-dark-color); color: var(--theme-dark-color);

View File

@ -128,18 +128,7 @@
flex-shrink: 0; flex-shrink: 0;
aspect-ratio: 1; aspect-ratio: 1;
background-color: var(--theme-button-default); background-color: var(--theme-button-default);
pointer-events: none; // pointer-events: none;
&.clickable {
cursor: pointer;
pointer-events: auto;
& > * {
pointer-events: none;
user-select: none;
-webkit-user-drag: none;
}
}
&.withStatus { &.withStatus {
mask-repeat: no-repeat; mask-repeat: no-repeat;
@ -211,6 +200,12 @@
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
} }
& > * {
pointer-events: none;
user-select: none;
-webkit-user-drag: none;
}
} }
/* Avatar sizes */ /* Avatar sizes */

View File

@ -123,7 +123,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions --> <!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="flex-presenter" use:tooltip={getPreviewPopup(person, showPreview)} on:click> <div class="flex-presenter" class:no-pointer={!clickable} use:tooltip={getPreviewPopup(person, showPreview)} on:click>
{#if showStatus && person} {#if showStatus && person}
<div class="relative"> <div class="relative">
<AvatarInstance <AvatarInstance
@ -140,7 +140,6 @@
{adaptiveName} {adaptiveName}
{disabled} {disabled}
{style} {style}
{clickable}
withStatus withStatus
/> />
<div <div
@ -164,13 +163,6 @@
{adaptiveName} {adaptiveName}
{disabled} {disabled}
{style} {style}
{clickable}
/> />
{/if} {/if}
</div> </div>
<style>
.flex-presenter {
cursor: pointer;
}
</style>

View File

@ -34,7 +34,6 @@
export let adaptiveName: boolean = false export let adaptiveName: boolean = false
export let disabled: boolean = false export let disabled: boolean = false
export let style: 'modern' | undefined = undefined export let style: 'modern' | undefined = undefined
export let clickable: boolean = false
function handleClick (): void { function handleClick (): void {
dispatch('click') dispatch('click')
@ -73,7 +72,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<div <div
bind:this={element} bind:this={element}
class="hulyAvatar-container hulyAvatarSize-{size} {variant} {style} {clickable ? 'clickable' : ''}" class="hulyAvatar-container hulyAvatarSize-{size} {variant} {style}"
class:no-img={!hasImg && color} class:no-img={!hasImg && color}
class:bordered={!hasImg && color === undefined} class:bordered={!hasImg && color === undefined}
class:border={bColor !== undefined} class:border={bColor !== undefined}
@ -97,7 +96,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<div <div
bind:this={element} bind:this={element}
class="hulyAvatar-container hulyAvatarSize-{size} {variant} {style} {clickable ? 'clickable' : ''}" class="hulyAvatar-container hulyAvatarSize-{size} {variant} {style}"
class:no-img={!hasImg && color} class:no-img={!hasImg && color}
class:bordered={!hasImg && color === undefined} class:bordered={!hasImg && color === undefined}
class:border={bColor !== undefined} class:border={bColor !== undefined}
@ -131,17 +130,3 @@
{/if} {/if}
</div> </div>
{/if} {/if}
<style>
.clickable {
cursor: pointer;
}
.clickable > * {
pointer-events: none;
}
.clickable img {
pointer-events: none;
user-select: none;
-webkit-user-drag: none;
}
</style>