Skip to content

fix(viewer): adapt screen and auto-scroll quick reply box when keyboard appears - #69

Merged
rathlinus merged 1 commit into
bulwarkmail:mainfrom
arnauda-gh:fix/quick-reply-keyboard-avoidance
Oct 10, 2026
Merged

rathlinus merged 1 commit into
bulwarkmail:mainfrom
arnauda-gh:fix/quick-reply-keyboard-avoidance

Conversation

@arnauda-gh

Copy link
Copy Markdown
Contributor

Summary

Fixes an issue where tapping the inline quick reply box (QuickReplyBox) on Android caused the virtual keyboard to cover the text input area, preventing users from seeing what they type.

Root Cause

  1. On Android edge-to-edge / react-native-screens, opening the IME keyboard does not automatically resize the root viewport.
  2. EmailThreadScreen had no keyboard obstruction tracking, leaving EmailPane's ScrollView with only static bottom padding (bottomBarHeight + spacing.lg), which left QuickReplyBox underneath the keyboard.
  3. The absolute bottom navigation bar (styles.bottomBar) remained mounted at the bottom of the screen.
  4. ScrollView lacked auto-scroll on focus to bring QuickReplyBox into view when focused.

Solution

  1. Keyboard obstruction tracking: Added a listener in EmailThreadScreen measuring visible keyboard obstruction from Dimensions.get('screen') (matching ComposeScreen).
  2. Dynamic bottom padding & auto-scroll: In EmailPane, dynamic bottom padding is applied (kbObstruction + spacing.md) when the keyboard is open, and scrollRef.current?.scrollToEnd({ animated: true }) automatically brings QuickReplyBox right above the keyboard on focus.
  3. Bottom bar hiding: The bottom navigation bar is hidden while typing (kbObstruction === 0) to maximize visible space.
  4. Input interaction: Added keyboardShouldPersistTaps="handled" and keyboardDismissMode="on-drag" to ScrollView for smooth keyboard and tap handling.
  5. Pager lock: Disabled horizontal paging while the keyboard is visible to prevent accidental swipe transitions while typing.

Verification

  • Manually tested and verified on physical device (Samsung Galaxy S21+ / Android 14): quick reply box smoothly scrolls into view right above the keyboard upon tapping, text and action buttons are fully visible, and the bottom bar restores when the keyboard is dismissed.
  • Vitest unit tests: 213 test files passing (3,217 tests).
  • TypeScript typecheck: passing without errors.

!! AI WARNING !! : This PR was generated and created by AI. It has been tested on my own use case and seems to work. However have a deep look about the generated code.

@rathlinus
rathlinus merged commit cf78b07 into bulwarkmail:main Oct 10, 2026
1 check passed
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