fix(editor): should not show toolbar when elements have been deleted (#11026)

Closes: [BS-2691](https://linear.app/affine-design/issue/BS-2691/[bug]-当-edgeless-为空的时候,点击-space-会在左上角出现一个莫名的-toolbar)
This commit is contained in:
fundon
2025-03-20 06:01:57 +00:00
parent 92d76ba571
commit 1f2caca3f5
2 changed files with 42 additions and 1 deletions

View File

@@ -157,6 +157,9 @@ export class AffineToolbarWidget extends WidgetComponent {
.map(id => gfx.getElementById(id))
.filter(model => model !== null) as GfxModel[];
// Should double check
activated &&= Boolean(elements.length);
hasLocked = elements.some(e => e.isLocked());
const grouped = groupBy(