Commit 645108e 1 parent 52bfae3 commit 645108e Copy full SHA for 645108e
File tree 1 file changed +11
-9
lines changed
blocksuite/affine/widget-toolbar/src
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,7 @@ import {
24
24
WidgetComponent ,
25
25
} from '@blocksuite/block-std' ;
26
26
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx' ;
27
- import {
28
- Bound ,
29
- getCommonBound ,
30
- nextTick ,
31
- throttle ,
32
- } from '@blocksuite/global/utils' ;
27
+ import { Bound , getCommonBound , throttle } from '@blocksuite/global/utils' ;
33
28
import type { Placement , ReferenceElement } from '@floating-ui/dom' ;
34
29
import { batch , effect , signal } from '@preact/signals-core' ;
35
30
import { css } from 'lit' ;
@@ -227,9 +222,7 @@ export class AffineToolbarWidget extends WidgetComponent {
227
222
// 1. Prevents flickering effects.
228
223
// 2. We cannot use `host.getUpdateComplete()` here
229
224
// because it would cause excessive DOM queries, leading to UI jamming.
230
- nextTick ( )
231
- . then ( ( ) => flags . refresh ( Flag . Text ) )
232
- . catch ( console . error ) ;
225
+ flags . refresh ( Flag . Text ) ;
233
226
} )
234
227
) ;
235
228
@@ -240,6 +233,15 @@ export class AffineToolbarWidget extends WidgetComponent {
240
233
flags . reset ( ) ;
241
234
return ;
242
235
}
236
+
237
+ if (
238
+ flags . check ( Flag . Block ) &&
239
+ record . type === 'update' &&
240
+ record . props . key === 'text'
241
+ ) {
242
+ flags . refresh ( Flag . Block ) ;
243
+ return ;
244
+ }
243
245
} )
244
246
) ;
245
247
You can’t perform that action at this time.
0 commit comments