diff --git a/package.json b/package.json index e3a2edd..5708a11 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/webflow/getCollectionElements.ts b/webflow/getCollectionElements.ts index b75338d..e9ea1c0 100644 --- a/webflow/getCollectionElements.ts +++ b/webflow/getCollectionElements.ts @@ -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(`.${emptyState}`); if (target === 'pageCount') return collectionListWrapper.querySelector(`.${pageCount}`); + if (target === 'empty') { + return collectionListWrapper.querySelector(`:scope > .${emptyState}`); + } if (target === 'pagination') { return collectionListWrapper.querySelector(`.${paginationWrapper}`); }