fix(editor): text align not work (#13740)

#### PR Dependency Tree


* **PR #13740** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun authored and GitHub committed 2025-10-14 03:10:38 +00:00
1 parent 50f41c2212
commit 59d8d0fbae
1 file changed
+1 -1
@@ -22,7 +22,7 @@ export const updateBlockAlign: Command<UpdateBlockAlignConfig> = (
) => { ) => {
let { std, textAlign, selectedBlocks } = ctx; let { std, textAlign, selectedBlocks } = ctx;
if (selectedBlocks === null) { if (!selectedBlocks) {
const [result, ctx] = std.command const [result, ctx] = std.command
.chain() .chain()
.tryAll(chain => [ .tryAll(chain => [