Skip to content

Commit

Permalink
fix: only update position, when formatting toolbar is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
m-risto committed Sep 17, 2024
1 parent c836292 commit b5a6c16
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ export class BnaFormattingToolbarControllerComponent {
cleanup();
//TODO: remove auto update
//had the problem that the first set position was not good
cleanup = autoUpdate(
getVirtualElement(formattingToolbar.referencePos),
this.elRef.nativeElement,
async () => {
await this.updateFormattingToolbarPosition(
formattingToolbar.referencePos,
);
},
);
if(formattingToolbar.show){
cleanup = autoUpdate(
getVirtualElement(formattingToolbar.referencePos),
this.elRef.nativeElement,
async () => {
await this.updateFormattingToolbarPosition(
formattingToolbar.referencePos,
);
},
);
}
});
}

Expand Down

0 comments on commit b5a6c16

Please sign in to comment.