Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -143,6 +143,7 @@ export const EditContactAttributesModal = ({
errorElement.focus();
}
}, 100);
return () => clearTimeout(timeoutId);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,9 @@ function DeviceFilter({

<SelectContent>
{operatorArr.map((operator) => (
<SelectItem value={operator.id}>{operator.name}</SelectItem>
<SelectItem key={operator.id} value={operator.id}>
{operator.name}
</SelectItem>
))}
</SelectContent>
</Select>
Expand All @@ -831,7 +833,9 @@ function DeviceFilter({
{ id: "desktop", name: t("workspace.segments.desktop") },
{ id: "phone", name: t("workspace.segments.phone") },
].map((operator) => (
<SelectItem value={operator.id}>{operator.name}</SelectItem>
<SelectItem key={operator.id} value={operator.id}>
{operator.name}
</SelectItem>
))}
</SelectContent>
</Select>
Expand Down
Loading