Bug(?): New paragraph nodes do not follow the alignment of previous paragraphs.
New paragraphs created using the Enter key do not follow the same alignment as the previous paragraph. I'm not sure if this is a bug or done intentionally.
Lexical version: Latest
Steps To Reproduce
- Right-align an existing paragraph.
- Press enter to create a new paragraph.
https://user-images.githubusercontent.com/88332746/236798633-e5e444cf-c1e4-4f3c-9931-e42d334cc3dc.mov
I was wondering the same thing. It's worth noting though that when using an RTL language (Hebrew for example), the selected alignment is persisted.
@michaelsoultanidis did you end up solving it? I'm experiencing the same issue.
You can use Shift+Enter for the moment, since it adds in the same paragraph this way vs a new paragraph with default alignment of 'left'. I agree this should be amended. Not sure on what the best approach here is, looking at the previous node does seem reasonable, but should be discussed.
Thanks @ivailop7. How does copying the previous paragraph style work then (e.g. font-color)? Both text-alignment and font-color are CSS properties of the TextNode.
I believer you are correct, yes, either it's missing a property in the place where it carries over the font style, which should be a simple fix or other logic overrides it.