Skip to content

Mode-switching workaround for keyboard controller issue 1453#443

Open
trcoffman wants to merge 2 commits into
LegendApp:mainfrom
trcoffman:workaround-1453
Open

Mode-switching workaround for keyboard controller issue 1453#443
trcoffman wants to merge 2 commits into
LegendApp:mainfrom
trcoffman:workaround-1453

Conversation

@trcoffman
Copy link
Copy Markdown
Contributor

@trcoffman trcoffman commented May 12, 2026

On Android, only enable anchoredEndSpace and contentInsetEndAdjustment features once the content is long enough to not trigger issue 1453 in KeyboardChatScrollView.

kirillzyusko/react-native-keyboard-controller#1453

This also includes a commit to fix a bug in contentInsetEndAdjustment where changing it remounts the scrollview. This commit should be extracted to a separate PR and then this PR can get rebased.

This is a competing workaround with #442 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: 5262e3619b

ℹ️ 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".

return;
}
return state.listen("totalSize", (totalSize) => {
if (totalSize > state.scrollLength + contentInsetEndAdjustment.value) {
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 Read the current scroll length before enabling anchored space

On Android/new-architecture mounts where the list ref is available before the final layout size is known, this captures the one-time getState() snapshot and keeps using its initial scrollLength for every later totalSize update. Since scrollLength is copied into the returned state object rather than kept live, the first content measurement can satisfy the check with a stale 0/old viewport and enable anchoredEndSpace while the content is still shorter than the actual viewport plus composer inset, reintroducing the KeyboardChatScrollView short-content path this guard is meant to avoid. Fetch the latest state inside the listener, or otherwise wait for the measured scroll length before flipping the flag.

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.

2 participants