diff --git a/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v1/productcollection/clientlibs/js/productcollection.js b/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v1/productcollection/clientlibs/js/productcollection.js index e7633e28a6..d9b62ff679 100644 --- a/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v1/productcollection/clientlibs/js/productcollection.js +++ b/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v1/productcollection/clientlibs/js/productcollection.js @@ -115,8 +115,7 @@ class ProductCollection { // Parse response and only select product items let text = await response.text(); - let domParser = new DOMParser(); - let more = domParser.parseFromString(text, 'text/html'); + let more = document.createRange().createContextualFragment(text); let moreItems = more.querySelectorAll(ProductCollection.selectors.item); // Append new product items to existing product gallery diff --git a/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v2/productcollection/clientlibs/js/productcollection.js b/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v2/productcollection/clientlibs/js/productcollection.js index c44d11eb40..3f98f00894 100644 --- a/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v2/productcollection/clientlibs/js/productcollection.js +++ b/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcollection/v2/productcollection/clientlibs/js/productcollection.js @@ -129,13 +129,11 @@ class ProductCollection { // Parse response and only select product items let text = await response.text(); - let domParser = new DOMParser(); - let more = domParser.parseFromString(text, 'text/html'); + let more = document.createRange().createContextualFragment(text); let moreItems = more.querySelectorAll( ProductCollection.selectors.item + ', ' + ProductCollection.selectors.xfitem ); - console.log('more', more, 'moreItems', moreItems); // Append new product items to existing product gallery let galleryItems = this._element.querySelector(ProductCollection.selectors.galleryItems); galleryItems.append(...moreItems);