mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 00:28:33 +00:00
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:
@@ -22,7 +22,7 @@ export const updateBlockAlign: Command<UpdateBlockAlignConfig> = (
|
||||
) => {
|
||||
let { std, textAlign, selectedBlocks } = ctx;
|
||||
|
||||
if (selectedBlocks === null) {
|
||||
if (!selectedBlocks) {
|
||||
const [result, ctx] = std.command
|
||||
.chain()
|
||||
.tryAll(chain => [
|
||||
|
||||
Reference in New Issue
Block a user