mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
Merge remote-tracking branch 'origin/develop' into fix/autofocus-board-editor
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import type { BlockEditor } from '@toeverything/components/editor-core';
|
||||
import { MIN_PAGE_WIDTH } from '@toeverything/components/editor-core';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import type { SyntheticEvent } from 'react';
|
||||
import type { MouseEvent, SyntheticEvent } from 'react';
|
||||
import { memo, useCallback, useEffect, useRef } from 'react';
|
||||
import {
|
||||
defaultTextStyle,
|
||||
@@ -149,6 +149,15 @@ export class EditorUtil extends TDShapeUtil<T, E> {
|
||||
})();
|
||||
}, [isEditing]);
|
||||
|
||||
const onMouseDown = useCallback(
|
||||
(e: MouseEvent) => {
|
||||
if (e.detail === 2) {
|
||||
app.setEditingText(shape.id);
|
||||
}
|
||||
},
|
||||
[app, shape.id]
|
||||
);
|
||||
|
||||
return (
|
||||
<HTMLContainer ref={ref} {...events}>
|
||||
<Container
|
||||
@@ -157,6 +166,7 @@ export class EditorUtil extends TDShapeUtil<T, E> {
|
||||
onPointerDown={stopPropagation}
|
||||
onMouseEnter={activateIfEditing}
|
||||
onDragEnter={activateIfEditing}
|
||||
onMouseDown={onMouseDown}
|
||||
>
|
||||
<MemoAffineEditor
|
||||
workspace={workspace}
|
||||
|
||||
Reference in New Issue
Block a user