-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ElementNode format #5708
Copy link
Copy link
Closed
Labels
all-platforms-bugcoreReconciler, DOM, Selection, Node, Events, CompositionReconciler, DOM, Selection, Node, Events, Compositiondiscussion
Description
There is a case that works well in three major editors: Word, GDoc and Pages that Lexical still doesn't do quite right. Preserving the format when there's no text.
While #5707 addresses part of the issue (retention of selection) it doesn't fix the retention while moving away.
There's a key ingredient that's missing here: persistance.
In HTML, browsers do this with:
<p>
<b>
</b>
</p>
In Lexical we never wanted to introduce this DOM structure because of redundancy, a11y (and the fact that we don't support nested HTML).
But we can do better, we can persist this format in the ElementNode. In the Lexical case, ElementNode would only store and use this in particular cases when the selection touches on the entirety of the Element. These are:
- Collapsed selection on an empty block ElementNode
- Entire block ElementNode selected (i.e. triple click)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
all-platforms-bugcoreReconciler, DOM, Selection, Node, Events, CompositionReconciler, DOM, Selection, Node, Events, Compositiondiscussion