Skip to content

Commit 3769099

Browse files
committed
Allow ref blots to be null
1 parent 5566ee0 commit 3769099

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [Unreleased]
22

3+
- Allow ref blots to be null
4+
35
# 3.0.0-rc.0
46

57
- Keep identify names in built code bundle

src/blot/abstract/blot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ export interface Parent extends Blot {
9696
index: number,
9797
length: number,
9898
): T[];
99-
insertBefore(child: Blot, refNode?: Blot): void;
100-
moveChildren(parent: Parent, refNode?: Blot): void;
99+
insertBefore(child: Blot, refNode?: Blot | null): void;
100+
moveChildren(parent: Parent, refNode?: Blot | null): void;
101101
path(index: number, inclusive?: boolean): [Blot, number][];
102102
removeChild(child: Blot): void;
103103
unwrap(): void;

src/blot/abstract/parent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class ParentBlot extends ShadowBlot implements Parent {
243243
}, 0);
244244
}
245245

246-
public moveChildren(targetParent: Parent, refNode?: Blot): void {
246+
public moveChildren(targetParent: Parent, refNode?: Blot | null): void {
247247
this.children.forEach((child) => {
248248
targetParent.insertBefore(child, refNode);
249249
});

0 commit comments

Comments
 (0)