Skip to content

Commit

Permalink
Allow ref blots to be null
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Apr 4, 2024
1 parent 5566ee0 commit 3769099
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# [Unreleased]

- Allow ref blots to be null

# 3.0.0-rc.0

- Keep identify names in built code bundle
Expand Down
4 changes: 2 additions & 2 deletions src/blot/abstract/blot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export interface Parent extends Blot {
index: number,
length: number,
): T[];
insertBefore(child: Blot, refNode?: Blot): void;
moveChildren(parent: Parent, refNode?: Blot): void;
insertBefore(child: Blot, refNode?: Blot | null): void;
moveChildren(parent: Parent, refNode?: Blot | null): void;
path(index: number, inclusive?: boolean): [Blot, number][];
removeChild(child: Blot): void;
unwrap(): void;
Expand Down
2 changes: 1 addition & 1 deletion src/blot/abstract/parent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class ParentBlot extends ShadowBlot implements Parent {
}, 0);
}

public moveChildren(targetParent: Parent, refNode?: Blot): void {
public moveChildren(targetParent: Parent, refNode?: Blot | null): void {
this.children.forEach((child) => {
targetParent.insertBefore(child, refNode);
});
Expand Down

0 comments on commit 3769099

Please sign in to comment.