Skip to content

Commit

Permalink
Golf; use replaceChildren in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmilton committed Dec 24, 2021
1 parent 11799dc commit 5239678
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/BookmarkBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const BookmarkBar = (): BookmarkBarComponent => {
// Add BookmarkNodes one at a time until they can't fit in the bookmark
// bar and then create a folder with the overflowing items
const resize = () => {
// Remove all child nodes
// Remove child nodes
root.textContent = '';

let otherBookmarksFolder;
Expand Down
5 changes: 1 addition & 4 deletions src/components/SearchResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ export const SearchResult = <T extends LinkProps>(
append((isOpenTabs ? TabLink : Link)(item), frag);
});

// Remove all child nodes
nodes.l.textContent = '';

append(frag, nodes.l);
nodes.l.replaceChildren(frag);

root.hidden = !renderedLength;
nodes.m.hidden = renderedLength >= listData.length;
Expand Down

0 comments on commit 5239678

Please sign in to comment.