diff --git a/react/components/Placeholder/Placeholder.tsx b/react/components/Placeholder/Placeholder.tsx index 7840422..f242ac3 100644 --- a/react/components/Placeholder/Placeholder.tsx +++ b/react/components/Placeholder/Placeholder.tsx @@ -1,16 +1,29 @@ const Placeholder = () => { if (typeof document !== "undefined") { - const postalCodeInput = document.querySelector( - ".vtex-address-form-4-x-input" - ); - const postalCodeValue = document.querySelector(".postalCode"); - if (postalCodeInput) { - postalCodeInput.classList.add("postalCode"); - } - if (postalCodeValue) { - postalCodeValue.setAttribute("placeholder", "Digite seu CEP"); - } + const observer = new MutationObserver(mutations => { + mutations.forEach(_mutation => { + const postalCodeInput = document.querySelector( + ".vtex-address-form-4-x-input" + ); + const postalCodeValue = document.querySelector(".postalCode"); + + if (postalCodeInput) { + postalCodeInput.classList.add("postalCode"); + observer.disconnect(); + } + + if (postalCodeValue) { + postalCodeValue.setAttribute("placeholder", "Digite seu CEP"); + } + }); + }); + + observer.observe(document, { + childList: true, + subtree: true + }); } + return null; }; diff --git a/store/blocks/pdp/product-breadcrumb.jsonc b/store/blocks/pdp/product-breadcrumb.jsonc index ba79c0b..9dbc58b 100644 --- a/store/blocks/pdp/product-breadcrumb.jsonc +++ b/store/blocks/pdp/product-breadcrumb.jsonc @@ -1,7 +1,6 @@ { "html#breadcrumb": { "props": { - "tag": "section", "testId": "breadcrumbs", "blockClass": "pdp-breadcrumb" },