AlessioGr/payload-plugin-lexical

Text-align styles conflict with font styles from editor data

jddunn opened this issue · 0 comments

jddunn commented

Problem:

If you're using Lexical editor in Payload CMS, and you want to give your text a style, if you do anything like bold or italicize the text, it wraps the text content in an object and assigns the key format some number like 0 or 1. This works, but the text alignment styles also use the same key format, so if you do both a text style and an alignment style, they overwrite each other and it outputs nothing, or the default value (0) for format.

Solution:

Change the text-alignment value that gets dynamically edited so it uses another key besides format. Maybe call it alignment?

Seems like it'd be a straightforward thing to fix.

Edit: Looks like I was doing something wrong, sorry