mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
fix(core): unexpected jump when clicking save tag (#8171)
close AF-1285 https://github.com/user-attachments/assets/1ec4adf5-4340-4e94-9e56-6a05e7a65f18
This commit is contained in:
@@ -73,6 +73,7 @@ export const editTagWrapper = style({
|
||||
width: '100%',
|
||||
height: '60px',
|
||||
display: 'none',
|
||||
zIndex: 1,
|
||||
selectors: {
|
||||
'&[data-show=true]': {
|
||||
background: cssVar('backgroundPrimaryColor'),
|
||||
|
||||
@@ -3,6 +3,7 @@ import { TagService } from '@affine/core/modules/tag';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import type { MouseEvent } from 'react';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import type { TagMeta } from '../types';
|
||||
@@ -107,6 +108,11 @@ export const CreateOrEditTag = ({
|
||||
return;
|
||||
}, [onClose, t, tag, tagIcon, tagMeta, tagName, tagOptions, tagList]);
|
||||
|
||||
const handlePropagation = useCallback((event: MouseEvent) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
if (menuOpen) return;
|
||||
@@ -138,6 +144,7 @@ export const CreateOrEditTag = ({
|
||||
className={styles.createTagWrapper}
|
||||
data-show={open}
|
||||
data-testid="edit-tag-modal"
|
||||
onClick={handlePropagation}
|
||||
>
|
||||
<Menu
|
||||
rootOptions={{
|
||||
|
||||
Reference in New Issue
Block a user