2023-01-28 20:03:56 +00:00
|
|
|
import React from "react";
|
2023-01-28 19:39:26 +00:00
|
|
|
|
|
|
|
const PlaceholderCep = () => {
|
2023-01-28 20:03:56 +00:00
|
|
|
new Promise(resolve => {
|
|
|
|
if (document.querySelectorAll(".vtex-address-form-4-x-input").length > 0) {
|
|
|
|
return resolve(Array.from(document.querySelectorAll(".vtex-address-form-4-x-input")));
|
|
|
|
}
|
2023-01-28 19:39:26 +00:00
|
|
|
|
2023-01-28 20:03:56 +00:00
|
|
|
const observer = new MutationObserver(() => {
|
|
|
|
if (document.querySelectorAll(".vtex-address-form-4-x-input").length > 0) {
|
|
|
|
resolve(document.querySelectorAll(".vtex-address-form-4-x-input"));
|
|
|
|
observer.disconnect();
|
|
|
|
}
|
|
|
|
});
|
2023-01-28 19:39:26 +00:00
|
|
|
|
2023-01-28 20:03:56 +00:00
|
|
|
observer.observe(document.body, {
|
|
|
|
childList: true,
|
|
|
|
subtree: true,
|
|
|
|
});
|
|
|
|
}).then((els: any) => {
|
|
|
|
els[0].placeholder = "Digite seu CEP";
|
|
|
|
});
|
2023-01-28 19:39:26 +00:00
|
|
|
|
2023-01-28 20:03:56 +00:00
|
|
|
return <></>;
|
|
|
|
};
|
2023-01-28 19:39:26 +00:00
|
|
|
|
2023-01-28 20:03:56 +00:00
|
|
|
export default PlaceholderCep;
|