From 152c7cb8aec7653f35db31f5759ed3a2efb89922 Mon Sep 17 00:00:00 2001 From: echatzief Date: Fri, 10 May 2024 03:32:59 +0300 Subject: [PATCH] fixed issue with blocking update attribute when we have multiple types at text-align-extension (#5097) --- packages/extension-text-align/src/text-align.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/extension-text-align/src/text-align.ts b/packages/extension-text-align/src/text-align.ts index 40d52ae09db..d9cc3a09b3b 100644 --- a/packages/extension-text-align/src/text-align.ts +++ b/packages/extension-text-align/src/text-align.ts @@ -60,11 +60,15 @@ export const TextAlign = Extension.create({ return false } - return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment })) + return this.options.types + .map(type => commands.updateAttributes(type, { textAlign: alignment })) + .every(response => response) }, unsetTextAlign: () => ({ commands }) => { - return this.options.types.every(type => commands.resetAttributes(type, 'textAlign')) + return this.options.types + .map(type => commands.resetAttributes(type, 'textAlign')) + .every(response => response) }, } },