Skip to content

Commit 2a08be2

Browse files
mrdivyanshetrepum
andauthored
[lexical] Chore: Added missing isInline function to TextNode (#7226)
Co-authored-by: Bob Ippolito <[email protected]>
1 parent cb89344 commit 2a08be2

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

packages/lexical/flow/Lexical.js.flow

+2
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ declare export class TextNode extends LexicalNode {
623623
getFormat(): number;
624624
getStyle(): string;
625625
isComposing(): boolean;
626+
isInline(): true;
626627
isToken(): boolean;
627628
isSegmented(): boolean;
628629
isDirectionless(): boolean;
@@ -698,6 +699,7 @@ declare export class LineBreakNode extends LexicalNode {
698699
getTextContent(): '\n';
699700
createDOM(): HTMLElement;
700701
updateDOM(): false;
702+
isInline(): true;
701703
static importJSON(
702704
serializedLineBreakNode: SerializedLineBreakNode,
703705
): LineBreakNode;

packages/lexical/src/nodes/LexicalLineBreakNode.ts

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export class LineBreakNode extends LexicalNode {
5050
return false;
5151
}
5252

53+
isInline(): true {
54+
return true;
55+
}
56+
5357
static importDOM(): DOMConversionMap | null {
5458
return {
5559
br: (node: Node) => {

packages/lexical/src/nodes/LexicalTextNode.ts

+7
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,13 @@ export class TextNode extends LexicalNode {
473473
return true;
474474
}
475475

476+
/**
477+
* @returns true if the text node is inline, false otherwise.
478+
*/
479+
isInline(): true {
480+
return true;
481+
}
482+
476483
// View
477484

478485
createDOM(config: EditorConfig, editor?: LexicalEditor): HTMLElement {

0 commit comments

Comments
 (0)