Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(blocks): click blank area will make editor scroll #8480

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/affine/block-list/src/list-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class ListBlockComponent extends CaptionedBlockComponent<
if (this.std.get(DocModeProvider).getEditorMode() === 'edgeless') {
return this.closest<BlockComponent>(NOTE_SELECTOR);
}
return this.rootComponent;
return super.topContenteditableElement;
}

private _select() {
Expand Down
2 changes: 1 addition & 1 deletion packages/affine/block-paragraph/src/paragraph-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class ParagraphBlockComponent extends CaptionedBlockComponent<
if (this.std.get(DocModeProvider).getEditorMode() === 'edgeless') {
return this.closest<BlockComponent>(NOTE_SELECTOR);
}
return this.rootComponent;
return super.topContenteditableElement;
}

override connectedCallback() {
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/src/code-block/code-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class CodeBlockComponent extends CaptionedBlockComponent<
const el = this.closest<BlockComponent>(NOTE_SELECTOR);
return el;
}
return this.rootComponent;
return super.topContenteditableElement;
}

private _updateHighlightTokens() {
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/src/data-view-block/data-view-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class DataViewBlockComponent extends CaptionedBlockComponent<DataViewBloc
const note = this.closest<NoteBlockComponent>('affine-note');
return note;
}
return this.rootComponent;
return super.topContenteditableElement;
}

get view() {
Expand Down
4 changes: 2 additions & 2 deletions packages/blocks/src/database-block/database-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent<

private renderTitle = (dataViewMethod: DataViewExpose) => {
const addRow = () => dataViewMethod.addRow?.('start');
return html` <affine-database-title
return html`<affine-database-title
style="overflow: hidden"
.titleText="${this.model.title}"
.readonly="${this.doc.readonly}"
Expand Down Expand Up @@ -303,7 +303,7 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent<
const note = this.closest<NoteBlockComponent>(NOTE_SELECTOR);
return note;
}
return this.rootComponent;
return super.topContenteditableElement;
}

get view() {
Expand Down
Loading
Loading