Skip to content

Commit

Permalink
blep
Browse files Browse the repository at this point in the history
  • Loading branch information
actualwitch committed Dec 21, 2024
1 parent 64818c3 commit 8c4aa88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/pages/NewExperiment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ const ActionRow = styled.div`
const TextArea = (props: React.TextareaHTMLAttributes<HTMLTextAreaElement>) => {
const ref = useRef<HTMLTextAreaElement | null>(null);
useEffect(() => {
if (!ref.current) return;
if (!ref.current || !props.value) return;
const docHeight = document.documentElement.clientHeight;
const contentScrollHeight = ref.current.scrollHeight;
const plannedHeight = Math.min(Math.max(contentScrollHeight, 0), Math.floor(docHeight / 2));
console.log(docHeight, contentScrollHeight, plannedHeight);
ref.current.style.height = "inherit";
ref.current.style.height = `${plannedHeight}px`;
}, [props.value]);
Expand Down
4 changes: 2 additions & 2 deletions src/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export const Shell = ({
</ErrorBoundary>
</Suspense>
{additionalScripts?.map((script, index) => {
return <script key={index} dangerouslySetInnerHTML={{ __html: script }} />;
return <script suppressHydrationWarning key={index} dangerouslySetInnerHTML={{ __html: script }} />;
})}
{bootstrap && <script type="module" src={`${baseUrl ?? ""}${clientFile}`} async />}
{bootstrap && <script suppressHydrationWarning type="module" src={`${baseUrl ?? ""}${clientFile}`} async />}
</body>
</html>
);
Expand Down

0 comments on commit 8c4aa88

Please sign in to comment.