forked from M3-Academy/challenge-vtex-io
Merge pull request 'Entrega do Desafio' (#21) from feature/challenge-vtex-io into develop
Reviewed-on: #21
This commit is contained in:
commit
c2ef23b404
@ -1,16 +1,29 @@
|
|||||||
const Placeholder = () => {
|
const Placeholder = () => {
|
||||||
if (typeof document !== "undefined") {
|
if (typeof document !== "undefined") {
|
||||||
const postalCodeInput = document.querySelector(
|
const observer = new MutationObserver(mutations => {
|
||||||
".vtex-address-form-4-x-input"
|
mutations.forEach(_mutation => {
|
||||||
);
|
const postalCodeInput = document.querySelector(
|
||||||
const postalCodeValue = document.querySelector(".postalCode");
|
".vtex-address-form-4-x-input"
|
||||||
if (postalCodeInput) {
|
);
|
||||||
postalCodeInput.classList.add("postalCode");
|
const postalCodeValue = document.querySelector(".postalCode");
|
||||||
}
|
|
||||||
if (postalCodeValue) {
|
if (postalCodeInput) {
|
||||||
postalCodeValue.setAttribute("placeholder", "Digite seu CEP");
|
postalCodeInput.classList.add("postalCode");
|
||||||
}
|
observer.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (postalCodeValue) {
|
||||||
|
postalCodeValue.setAttribute("placeholder", "Digite seu CEP");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document, {
|
||||||
|
childList: true,
|
||||||
|
subtree: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"html#breadcrumb": {
|
"html#breadcrumb": {
|
||||||
"props": {
|
"props": {
|
||||||
"tag": "section",
|
|
||||||
"testId": "breadcrumbs",
|
"testId": "breadcrumbs",
|
||||||
"blockClass": "pdp-breadcrumb"
|
"blockClass": "pdp-breadcrumb"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user