Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

The chat input could appear way too big vertically on initial app launch, then collapse to correct size when text was entered or window was resized.

Root cause: useEffect runs asynchronously after paint, so the initial scrollHeight measurement could happen before layout settled, resulting in an incorrect (too large) height.

Fix: Switch to useLayoutEffect which runs synchronously after DOM mutations but before the browser paints, ensuring accurate initial height measurement.


Generated with mux

The chat input could appear way too big vertically on initial app launch,
then collapse to correct size when text was entered or window was resized.

Root cause: useEffect runs asynchronously after paint, so the initial
scrollHeight measurement could happen before layout settled, resulting
in an incorrect (too large) height that persisted until next value change.

Fix: Switch to useLayoutEffect which runs synchronously after DOM mutations
but before the browser paints, ensuring accurate initial height measurement.
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@ammario ammario merged commit 12cf0f4 into main Dec 2, 2025
13 checks passed
@ammario ammario deleted the fix-chat-input-initial-size branch December 2, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants