fix: fix a bug where setting text align isn’t working when heading extension is not added

This commit is contained in:
Philipp Kühn
2021-06-17 17:34:06 +02:00
parent 108c081001
commit ddb9a4bf18

View File

@@ -60,10 +60,10 @@ export const TextAlign = Extension.create<TextAlignOptions>({
return false
}
return this.options.types.every(type => commands.updateAttributes(type, { textAlign: alignment }))
return this.options.types.some(type => commands.updateAttributes(type, { textAlign: alignment }))
},
unsetTextAlign: () => ({ commands }) => {
return this.options.types.every(type => commands.resetAttributes(type, 'textAlign'))
return this.options.types.some(type => commands.resetAttributes(type, 'textAlign'))
},
}
},