Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug(?): New paragraph nodes do not follow the alignment of previous paragraphs. #4468

Closed
michaelsoultanidis opened this issue May 8, 2023 · 5 comments · Fixed by #5878 or #5900 · May be fixed by Opetushallitus/kouta-ui#574
Closed
Labels
all-platforms-bug core Reconciler, DOM, Selection, Node, Events, Composition

Comments

@michaelsoultanidis
Copy link

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

  1. Right-align an existing paragraph.
  2. Press enter to create a new paragraph.
Screen.Recording.2023-05-08.at.1.09.40.PM.mov
@AndreyGalchevski
Copy link

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.

@arielyz
Copy link

arielyz commented Nov 6, 2023

@michaelsoultanidis did you end up solving it? I'm experiencing the same issue.

@ivailop7
Copy link
Collaborator

ivailop7 commented Nov 7, 2023

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.

@arielyz
Copy link

arielyz commented Nov 7, 2023

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.

@ivailop7
Copy link
Collaborator

ivailop7 commented Nov 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all-platforms-bug core Reconciler, DOM, Selection, Node, Events, Composition
Projects
None yet
5 participants