diff --git a/apps/web/modules/ee/contacts/components/edit-contact-attributes-modal.tsx b/apps/web/modules/ee/contacts/components/edit-contact-attributes-modal.tsx index 9d5425bece7c..cbae7b9cf874 100644 --- a/apps/web/modules/ee/contacts/components/edit-contact-attributes-modal.tsx +++ b/apps/web/modules/ee/contacts/components/edit-contact-attributes-modal.tsx @@ -133,7 +133,7 @@ export const EditContactAttributesModal = ({ const errorFieldId = `attribute-key-${firstErrorIndex}`; const errorElement = document.getElementById(errorFieldId); if (errorElement) { - setTimeout(() => { + const timeoutId = setTimeout(() => { errorElement.scrollIntoView({ behavior: "smooth", block: "center" }); // Try to focus the input inside the combobox if it exists const inputElement = errorElement.querySelector("input") as HTMLInputElement; @@ -143,6 +143,7 @@ export const EditContactAttributesModal = ({ errorElement.focus(); } }, 100); + return () => clearTimeout(timeoutId); } } } diff --git a/apps/web/modules/ee/contacts/components/upload-contacts-button.tsx b/apps/web/modules/ee/contacts/components/upload-contacts-button.tsx index ffc3e21fc974..b110c49f0b07 100644 --- a/apps/web/modules/ee/contacts/components/upload-contacts-button.tsx +++ b/apps/web/modules/ee/contacts/components/upload-contacts-button.tsx @@ -337,9 +337,10 @@ export const UploadContactsCSVButton = ({ useEffect(() => { if (error && errorContainerRef.current) { // Small delay to ensure DOM has updated and the alert is visible - setTimeout(() => { + const timeoutId = setTimeout(() => { errorContainerRef.current?.scrollIntoView({ behavior: "smooth", block: "center" }); }, 100); + return () => clearTimeout(timeoutId); } }, [error]); diff --git a/apps/web/modules/ee/contacts/segments/components/segment-filter.tsx b/apps/web/modules/ee/contacts/segments/components/segment-filter.tsx index 5fee8f2e3bd6..66a324b67010 100644 --- a/apps/web/modules/ee/contacts/segments/components/segment-filter.tsx +++ b/apps/web/modules/ee/contacts/segments/components/segment-filter.tsx @@ -811,7 +811,9 @@ function DeviceFilter({ {operatorArr.map((operator) => ( - {operator.name} + + {operator.name} + ))} @@ -831,7 +833,9 @@ function DeviceFilter({ { id: "desktop", name: t("workspace.segments.desktop") }, { id: "phone", name: t("workspace.segments.phone") }, ].map((operator) => ( - {operator.name} + + {operator.name} + ))}