perf(editor): fix autoUpdate being continuously added when updating selections (#9727)

Since `updated` is triggered every time click or update the selection, `autoUpdate` will be continuously added.

Case: select text and `Shift+ArrowLeft/ArrowRight`
This commit is contained in:
fundon
2025-01-16 09:05:10 +00:00
parent 562e358dac
commit 268e89911a

View File

@@ -567,10 +567,12 @@ export class AffineFormatBarWidget extends WidgetComponent {
}
override updated() {
if (this._floatDisposables) {
this._floatDisposables.dispose();
this._floatDisposables = null;
}
if (!this._shouldDisplay()) {
if (this._floatDisposables) {
this._floatDisposables.dispose();
}
return;
}