fix(editor): should update icon status when formatting the entire block text (#10508)

Closes: [BS-2718](https://linear.app/affine-design/issue/BS-2718/当处于-block-selection-状态且对整段进行-formatting-时,应该更新对应图标状态)
This commit is contained in:
fundon
2025-03-07 03:22:00 +00:00
parent 98d44d5be5
commit 916134b1da
2 changed files with 13 additions and 2 deletions

View File

@@ -257,6 +257,19 @@ export class AffineToolbarWidget extends WidgetComponent {
})
);
disposables.add(
std.store.slots.blockUpdated.on(record => {
if (
flags.isBlock() &&
record.type === 'update' &&
record.props.key === 'text'
) {
flags.refresh(Flag.Block);
return;
}
})
);
// Handles `drag and drop`
const dragStart = () => flags.toggle(Flag.Hiding, true);
const dragEnd = () => flags.toggle(Flag.Hiding, false);