Skip to content

Commit

Permalink
fix(edgeless): click on the whiteboard throw error when the format-ba…
Browse files Browse the repository at this point in the history
…r is active (#6662)
  • Loading branch information
Flrande committed Apr 1, 2024
1 parent e8ffc5c commit 0ea1275
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ export class AffineFormatBarWidget extends WidgetElement {
let targetRect: DOMRect | null = null;
if (this.displayType === 'text' || this.displayType === 'native') {
const range = this.nativeRange;
assertExists(range);
if (!range) {
this._reset();
return;
}
targetRect = range.getBoundingClientRect();
} else if (this.displayType === 'block') {
const blockElement = this._selectedBlockElements[0];
Expand Down

0 comments on commit 0ea1275

Please sign in to comment.