Skip to content

Commit

Permalink
fixed issue with blocking update attribute when we have multiple type…
Browse files Browse the repository at this point in the history
…s at text-align-extension (#5097)
  • Loading branch information
echatzief committed May 10, 2024
1 parent bf1e6bb commit 152c7cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/extension-text-align/src/text-align.ts
Expand Up @@ -60,11 +60,15 @@ export const TextAlign = Extension.create<TextAlignOptions>({
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)
},
}
},
Expand Down

0 comments on commit 152c7cb

Please sign in to comment.