Skip to content

Commit

Permalink
getCollectionElements: Fixed empty query potentially retrieving n…
Browse files Browse the repository at this point in the history
…ested Collection's Empty Element.
  • Loading branch information
alexiglesias93 committed Dec 8, 2021
1 parent 89c0e36 commit 40c11d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@finsweet/ts-utils",
"version": "0.27.0",
"version": "0.27.1",
"description": "Typescript utils for custom Webflow projects.",
"main": "index.ts",
"module": "index.ts",
Expand Down
4 changes: 3 additions & 1 deletion webflow/getCollectionElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ export function getCollectionElements(
if (target === 'wrapper') return collectionListWrapper;
if (target === 'list') return collectionList;
if (target === 'items') return [...(collectionList?.children || [])] as CollectionItemElement[];
if (target === 'empty') return collectionListWrapper.querySelector<CollectionListWrapperElement>(`.${emptyState}`);
if (target === 'pageCount') return collectionListWrapper.querySelector<PageCountElement>(`.${pageCount}`);
if (target === 'empty') {
return collectionListWrapper.querySelector<CollectionListWrapperElement>(`:scope > .${emptyState}`);
}
if (target === 'pagination') {
return collectionListWrapper.querySelector<PaginationWrapperElement>(`.${paginationWrapper}`);
}
Expand Down

0 comments on commit 40c11d1

Please sign in to comment.