fix(core): unexpected routing jump behavior (#6524)

https://github.com/toeverything/AFFiNE/assets/102217452/b4dba402-b07d-4f8e-a118-a35eb6e7d317
This commit is contained in:
JimmFly
2024-04-11 10:30:45 +00:00
parent 313952c45d
commit 7a1eb63d42
2 changed files with 6 additions and 6 deletions

View File

@@ -1,10 +1,10 @@
import { Checkbox } from '@affine/component';
import { getDNDId } from '@affine/core/hooks/affine/use-global-dnd-helper';
import { WorkbenchLink } from '@affine/core/modules/workbench';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useDraggable } from '@dnd-kit/core';
import type { PropsWithChildren } from 'react';
import { useCallback, useMemo } from 'react';
import { Link } from 'react-router-dom';
import { selectionStateAtom, useAtom } from '../scoped-atoms';
import type {
@@ -219,9 +219,9 @@ function CollectionListItemWrapper({
if (to) {
return (
<Link {...commonProps} to={to}>
<WorkbenchLink {...commonProps} to={to}>
{children}
</Link>
</WorkbenchLink>
);
} else {
return <div {...commonProps}>{children}</div>;

View File

@@ -1,10 +1,10 @@
import { Checkbox } from '@affine/component';
import { getDNDId } from '@affine/core/hooks/affine/use-global-dnd-helper';
import { WorkbenchLink } from '@affine/core/modules/workbench';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useDraggable } from '@dnd-kit/core';
import type { PropsWithChildren } from 'react';
import { useCallback, useMemo } from 'react';
import { Link } from 'react-router-dom';
import { selectionStateAtom, useAtom } from '../scoped-atoms';
import type { DraggableTitleCellData, TagListItemProps } from '../types';
@@ -205,9 +205,9 @@ function TagListItemWrapper({
if (to) {
return (
<Link {...commonProps} to={to}>
<WorkbenchLink {...commonProps} to={to}>
{children}
</Link>
</WorkbenchLink>
);
} else {
return <div {...commonProps}>{children}</div>;