Repository navigation
exportDOM methods for HeadingNode, QuoteNode - #4445
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
|
||
| const indent = this.getIndent(); | ||
| if (indent > 0) { | ||
| element.style.textIndent = `${indent * 20}px`; |
There was a problem hiding this comment.
I don't think any of these apply to list item, but indent especially will not do what we want here, as indent has a different implementation in lists than in elements generally. Also I'm not sure we should be using textIndent anywhere, as it only indents the first line of the text.
There was a problem hiding this comment.
Agree that it does not make sense for lists, as for textIndent for other nodes seems like this one is the explanation:
https://github.com/facebook/lexical/blob/aabb5b6ae91193071c1c8b7c53891da49e4c6f83/packages/lexical/src/nodes/LexicalParagraphNode.ts#L82-L85
There was a problem hiding this comment.
Thank you @acywatson and @fantactuka will remove the textIndent part, I actually didn't realize it was even a thing outside of lists. What would be the correct way to solve this for lists, where should I be looking to solve the alignment on an individual list item level.
There was a problem hiding this comment.
seems like this one is the explanation:
Yea but if you look at the docs, these do completely different things:
I don't understand how that text-indent property is working the same way as padding-inline-start.
where should I be looking to solve the alignment on an individual list item level.
Alignment in what sense? List indentation is semantic rather than stylistic in Lexical.
There was a problem hiding this comment.
as in having a single item from a list have justification "right", while the others remain with "left" justification. The bullet icon remains still correctly indented, it's just the text alignment on the row.
|
@acywatson Could I get a second look. I've removed the list item part. |
Adding exportDOM methods for the HeadingNode, QuoteNode (rich-text package). All of the changes are outside of the core, so adding the methods should be safe performance-wise.
Before:
exportDOM-pre.mp4
After:
exportDOMs-post.mp4