From 59d8d0fbae528d3bdbdde9822f387a98ea9e2263 Mon Sep 17 00:00:00 2001 From: L-Sun Date: Tue, 14 Oct 2025 11:10:38 +0800 Subject: [PATCH] fix(editor): text align not work (#13740) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### PR Dependency Tree * **PR #13740** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) ## Summary by CodeRabbit * **Bug Fixes** * Improved reliability of updating block alignment when the current selection isn’t explicitly defined. The editor now retrieves the selection more consistently, reducing cases where alignment controls appeared unresponsive or had no effect. * Covers scenarios during initialization or edge cases where selection was previously missed, resulting in smoother editing and fewer false negatives when applying alignment. * No changes to visible UI or shortcuts; behavior is simply more consistent. --- .../affine/blocks/note/src/commands/update-block-align.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocksuite/affine/blocks/note/src/commands/update-block-align.ts b/blocksuite/affine/blocks/note/src/commands/update-block-align.ts index 901bb1803..6ede2fa0d 100644 --- a/blocksuite/affine/blocks/note/src/commands/update-block-align.ts +++ b/blocksuite/affine/blocks/note/src/commands/update-block-align.ts @@ -22,7 +22,7 @@ export const updateBlockAlign: Command = ( ) => { let { std, textAlign, selectedBlocks } = ctx; - if (selectedBlocks === null) { + if (!selectedBlocks) { const [result, ctx] = std.command .chain() .tryAll(chain => [