mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user