mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix(editor): textarea not focusing in AI panel (#11429)
Closes: [BS-3006](https://linear.app/affine-design/issue/BS-3006/insider上面,圈选yuan素后,ad-hoc的ai对话框焦点控制有大问题(无法对焦,总是会跳走))
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
} from '@blocksuite/affine/shared/utils';
|
||||
import { WidgetComponent, WidgetViewExtension } from '@blocksuite/affine/std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/affine/std/gfx';
|
||||
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/affine/std/inline';
|
||||
import type { BaseSelection } from '@blocksuite/affine/store';
|
||||
import {
|
||||
autoPlacement,
|
||||
@@ -415,6 +416,8 @@ export class AffineAIPanelWidget extends WidgetComponent {
|
||||
super.connectedCallback();
|
||||
|
||||
this.tabIndex = -1;
|
||||
// No need to synchronize the contents of the input into the editor.
|
||||
this.setAttribute(RANGE_SYNC_EXCLUDE_ATTR, 'true');
|
||||
this.disposables.addFromEvent(
|
||||
document,
|
||||
'pointerdown',
|
||||
@@ -437,6 +440,9 @@ export class AffineAIPanelWidget extends WidgetComponent {
|
||||
this.disposables.addFromEvent(this, 'wheel', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'pointerdown', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'pointerup', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'cut', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'copy', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'paste', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'keydown', this._onKeyDown);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user