Skip to content

Commit b48cc82

Browse files
committed
fix(core): unexpected jump when clicking save tag (#8171)
close AF-1285 https://github.com/user-attachments/assets/1ec4adf5-4340-4e94-9e56-6a05e7a65f18
1 parent 32f673f commit b48cc82

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/frontend/core/src/components/page-list/list.css.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const editTagWrapper = style({
7373
width: '100%',
7474
height: '60px',
7575
display: 'none',
76+
zIndex: 1,
7677
selectors: {
7778
'&[data-show=true]': {
7879
background: cssVar('backgroundPrimaryColor'),

packages/frontend/core/src/components/page-list/tags/create-tag.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { TagService } from '@affine/core/modules/tag';
33
import { useI18n } from '@affine/i18n';
44
import { useLiveData, useService } from '@toeverything/infra';
55
import clsx from 'clsx';
6+
import type { MouseEvent } from 'react';
67
import { useCallback, useEffect, useMemo, useState } from 'react';
78

89
import type { TagMeta } from '../types';
@@ -107,6 +108,11 @@ export const CreateOrEditTag = ({
107108
return;
108109
}, [onClose, t, tag, tagIcon, tagMeta, tagName, tagOptions, tagList]);
109110

111+
const handlePropagation = useCallback((event: MouseEvent) => {
112+
event.preventDefault();
113+
event.stopPropagation();
114+
}, []);
115+
110116
useEffect(() => {
111117
if (!open) return;
112118
if (menuOpen) return;
@@ -138,6 +144,7 @@ export const CreateOrEditTag = ({
138144
className={styles.createTagWrapper}
139145
data-show={open}
140146
data-testid="edit-tag-modal"
147+
onClick={handlePropagation}
141148
>
142149
<Menu
143150
rootOptions={{

0 commit comments

Comments
 (0)