mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix(core): unexpected routing jump behavior (#6524)
https://github.com/toeverything/AFFiNE/assets/102217452/b4dba402-b07d-4f8e-a118-a35eb6e7d317
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user