Skip to content

How to keep formatting between lines? #5620

@nickschinestzki

Description

@nickschinestzki

I'm trying to achieve a different behavior regarding the formatting between lines in the Lexical Editor.

The current behavior

  1. In an empty editor, the user starts adding formatting and styles in the editor (font-family, font-size, color, bold, italic, etc)
  2. When you press Enter once, it will insert a new line, which will have an "unstyled cursor" but upon new typing, the styles and formatting are applied again to the text.
  3. When you press Enter twice, the new line, separated by the other ones, will lose all of the previous formatting and styling, returning to the default.
Gravacao.de.Tela.2024-02-16.as.09.16.21.mov

The desired behavior

  1. In an empty editor, the user starts adding formatting and styles in the editor (font-family, font-size, color, bold, italic, etc)
  2. When pressing Enter regarding of how much times/lines, the styles and formats are preserved. The user doesn't have to select the font-family and font-size again (for example) every time he creates a new a paragraph.

How can I achieve this?

Originally posted by @nickschinestzki in #5619

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions