Skip to content

AI Chat Keyboard Example: Add Android scroll-clamp workaround for keyboard-controller bug 1453#442

Open
trcoffman wants to merge 1 commit into
LegendApp:mainfrom
trcoffman:workaround-1453-with-spacer
Open

AI Chat Keyboard Example: Add Android scroll-clamp workaround for keyboard-controller bug 1453#442
trcoffman wants to merge 1 commit into
LegendApp:mainfrom
trcoffman:workaround-1453-with-spacer

Conversation

@trcoffman
Copy link
Copy Markdown
Contributor

@trcoffman trcoffman commented May 12, 2026

Use a paddingTop spacer and scroll clamping to work around kirillzyusko/react-native-keyboard-controller#1453

This ensures the content will always be long enough to be scrollable on Android.

This is a competing workaround with #443 and only one of them should be used.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66b3f8d4b9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

);

const contentContainerStyle = useMemo<ViewStyle | null>(
() => (spacerHeight > 0 ? { paddingTop: spacerHeight } : null),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the spacer scroll range reachable

When the actual chat content is shorter than the list viewport, adding only paddingTop: spacerHeight does not make scrollY >= spacerHeight reachable: the maximum offset is roughly spacerHeight + contentHeight - viewportHeight, which is still below spacerHeight unless the real content is at least one viewport tall. On the initial Android fixture after this commit shortens INITIAL_AI_TEXT, scrollTo(..., spacer) will clamp below the spacer, leaving the injected blank area visible and the keyboard-controller short-content case still broken. Add enough trailing/bottom space or compute the spacer from the measured content so the clamp target is within the scrollable range.

Useful? React with 👍 / 👎.

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.

1 participant