Skip to content

Commit dd14cd5

Browse files
committed
fix: append pending inline text at resolution time rather than immediately during close if blocked
This fixes an issue where an inline host node would remain empty if it was the last node in the tree and a blocking node was encountered.
1 parent 020d50b commit dd14cd5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ export = function writableDOM(
7474
}
7575
},
7676
close() {
77-
appendInlineTextIfNeeded(pendingText, inlineHostNode);
78-
79-
return isBlocked
77+
const promise = isBlocked
8078
? new Promise<void>((_) => (resolve = _))
8179
: Promise.resolve();
80+
81+
return promise.then(() => {
82+
appendInlineTextIfNeeded(pendingText, inlineHostNode);
83+
});
8284
},
8385
};
8486

0 commit comments

Comments
 (0)