mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
fix: drag embed block preview (#9791)
Fixes [BS-1518](https://linear.app/affine-design/issue/BS-1518/拖拽一个-embed-view-的-linked-doc,其-indicator-是错误的)
This commit is contained in:
@@ -98,6 +98,10 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
|
||||
this._hideOutsideBlock();
|
||||
};
|
||||
|
||||
if (!this.enableChildrenSchedule) {
|
||||
delete this.scheduleUpdateChildren;
|
||||
}
|
||||
|
||||
viewportUpdateCallback();
|
||||
this.disposables.add(
|
||||
this.viewport.viewportUpdated.on(() => viewportUpdateCallback())
|
||||
@@ -111,7 +115,7 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
|
||||
return html``;
|
||||
}
|
||||
|
||||
scheduleUpdateChildren(id: string) {
|
||||
scheduleUpdateChildren? = (id: string) => {
|
||||
const { promise, resolve } = Promise.withResolvers<void>();
|
||||
|
||||
this._pendingChildrenUpdates.push({ id, resolve });
|
||||
@@ -143,7 +147,7 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
|
||||
}
|
||||
|
||||
return promise;
|
||||
}
|
||||
};
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor getModelsInViewport: undefined | (() => Set<GfxBlockElementModel>);
|
||||
@@ -154,6 +158,9 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
|
||||
@property({ type: Number })
|
||||
accessor maxConcurrentRenders: number = 2;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor enableChildrenSchedule: boolean = true;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor viewport!: Viewport;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user