Skip to content

Commit

Permalink
Bug: Align list item do not change the export DOM (#5160)
Browse files Browse the repository at this point in the history
Co-authored-by: Trường Vĩnh Trịnh <[email protected]>
  • Loading branch information
trinhvinhtruong96 and trinhvinhtruong820 authored Nov 15, 2023
1 parent 8195bc4 commit 37aeced
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/lexical-list/src/LexicalListItemNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {ListNode} from './';
import type {
DOMConversionMap,
DOMConversionOutput,
DOMExportOutput,
EditorConfig,
EditorThemeClasses,
GridSelection,
Expand All @@ -34,6 +35,7 @@ import {
$isParagraphNode,
$isRangeSelection,
ElementNode,
LexicalEditor,
} from 'lexical';
import invariant from 'shared/invariant';

Expand Down Expand Up @@ -132,6 +134,14 @@ export class ListItemNode extends ElementNode {
return node;
}

exportDOM(editor: LexicalEditor): DOMExportOutput {
const element = this.createDOM(editor._config);
element.style.textAlign = this.getFormatType();
return {
element,
};
}

exportJSON(): SerializedListItemNode {
return {
...super.exportJSON(),
Expand Down

2 comments on commit 37aeced

@vercel
Copy link

@vercel vercel bot commented on 37aeced Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical.dev
lexical-fbopensource.vercel.app
lexical-git-main-fbopensource.vercel.app
lexicaljs.org
lexicaljs.com
www.lexical.dev

@vercel
Copy link

@vercel vercel bot commented on 37aeced Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-git-main-fbopensource.vercel.app
lexical-playground-fbopensource.vercel.app
lexical-playground.vercel.app
playground.lexical.dev

Please sign in to comment.