Skip to content

Commit

Permalink
debug resizeobserver
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Nov 6, 2024
1 parent 3e1d2f4 commit ea3e36e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
7 changes: 4 additions & 3 deletions src/aipane/components/Aipane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ const Aipane: React.FC<AipaneProps> = (props: AipaneProps): React.JSX.Element =>
console.error("ResizeObserver loop error in Aipane");
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
}
};
window.addEventListener("error", resizeObserverErr);
return () => {
window.removeEventListener("error", resizeObserverErr);
};
// return () => {
// window.removeEventListener("error", resizeObserverErr);
// };
}, []);

return (
Expand Down
7 changes: 4 additions & 3 deletions src/aipane/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
console.error("ResizeObserver loop error in Header");
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
}
};
window.addEventListener("error", resizeObserverErr);
return () => {
window.removeEventListener("error", resizeObserverErr);
};
// return () => {
// window.removeEventListener("error", resizeObserverErr);
// };
}, []);

return (
Expand Down
7 changes: 4 additions & 3 deletions src/aipane/components/HeroApiKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ const HeroApiKey: React.FC<HeroApiKeyProps> = ({ apiKey, onApiKeyChange, onApiKe
console.error("ResizeObserver loop error in HeroApiKey");
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
}
};
window.addEventListener("error", resizeObserverErr);
return () => {
window.removeEventListener("error", resizeObserverErr);
};
// return () => {
// window.removeEventListener("error", resizeObserverErr);
// };
}, []);

return (
Expand Down
7 changes: 4 additions & 3 deletions src/aipane/components/HeroComboPrompts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ const HeroComboPrompts: React.FC<HeroComboPromptsProps> = ({ onChange, standalon
console.error("ResizeObserver loop error in HeroComboPrompts");
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
}
};
window.addEventListener("error", resizeObserverErr);
return () => {
window.removeEventListener("error", resizeObserverErr);
};
// return () => {
// window.removeEventListener("error", resizeObserverErr);
// };
}, []);

return (
Expand Down
7 changes: 4 additions & 3 deletions src/aipane/components/HeroModels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ const HeroModels: React.FC<HeroModelsProps> = ({ onChange, provider }) => {
console.error("ResizeObserver loop error in HeroModels");
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
}
};
window.addEventListener("error", resizeObserverErr);
return () => {
window.removeEventListener("error", resizeObserverErr);
};
// return () => {
// window.removeEventListener("error", resizeObserverErr);
// };
}, []);

return (
Expand Down
7 changes: 4 additions & 3 deletions src/aipane/components/HeroProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ const HeroProviders: React.FC<HeroProvidersProps> = ({ onChange }) => {
console.error("ResizeObserver loop error in HeroProviders");
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
}
};
window.addEventListener("error", resizeObserverErr);
return () => {
window.removeEventListener("error", resizeObserverErr);
};
// return () => {
// window.removeEventListener("error", resizeObserverErr);
// };
}, []);

const handleChange = React.useCallback(
Expand Down
7 changes: 4 additions & 3 deletions src/aipane/components/TextInsertion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,13 @@ const TextInsertion: React.FC<TextInsertionProps> = (props: TextInsertionProps):
console.error("ResizeObserver loop error in TextInsertion");
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
}
};
window.addEventListener("error", resizeObserverErr);
return () => {
window.removeEventListener("error", resizeObserverErr);
};
// return () => {
// window.removeEventListener("error", resizeObserverErr);
// };
}, []);

return (
Expand Down

0 comments on commit ea3e36e

Please sign in to comment.