Skip to content

Commit 5239678

Browse files
committed
Golf; use replaceChildren in search results
1 parent 11799dc commit 5239678

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/components/BookmarkBar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const BookmarkBar = (): BookmarkBarComponent => {
2929
// Add BookmarkNodes one at a time until they can't fit in the bookmark
3030
// bar and then create a folder with the overflowing items
3131
const resize = () => {
32-
// Remove all child nodes
32+
// Remove child nodes
3333
root.textContent = '';
3434

3535
let otherBookmarksFolder;

src/components/SearchResult.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ export const SearchResult = <T extends LinkProps>(
4949
append((isOpenTabs ? TabLink : Link)(item), frag);
5050
});
5151

52-
// Remove all child nodes
53-
nodes.l.textContent = '';
54-
55-
append(frag, nodes.l);
52+
nodes.l.replaceChildren(frag);
5653

5754
root.hidden = !renderedLength;
5855
nodes.m.hidden = renderedLength >= listData.length;

0 commit comments

Comments
 (0)