Skip to content

Fix iPad keyboard toolbar overlay handling - #455

Merged
2witstudios merged 1 commit into
masterfrom
claude/fix-ipad-safe-zone-1eQOM
Feb 6, 2026
Merged

2witstudios merged 1 commit into
masterfrom
claude/fix-ipad-safe-zone-1eQOM

Conversation

@2witstudios

@2witstudios 2witstudios commented Feb 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Improved handling of iPad's external keyboard toolbar to prevent unnecessary UI shrinking while maintaining proper keyboard support for full on-screen keyboards.

Key Changes

  • useIOSKeyboardInit.ts: Added detection for iPad's external keyboard toolbar (< 100px height) to distinguish it from full on-screen keyboards. The toolbar now overlays naturally without triggering keyboard-open state or shrinking the UI.
  • InputPositioner.tsx: Added a background fill element behind the safe area that extends behind the iPad keyboard toolbar, ensuring visual continuity when the UI extends behind the toolbar.
  • globals.css: Set explicit background color on the html element to ensure consistent background rendering across the entire viewport.

Implementation Details

  • The external keyboard toolbar detection uses a 100px height threshold, as iPad toolbars are typically ~55px while full keyboards are 300+px
  • The background fill div uses CSS custom property --safe-bottom-offset for flexible height configuration
  • The fill element is only rendered when content is not centered, maintaining layout consistency
  • All changes maintain backward compatibility with existing keyboard handling for standard on-screen keyboards

https://claude.ai/code/session_01UBHund2513D3bvW2pjqLXo

Summary by CodeRabbit

  • Bug Fixes
    • Improved visual rendering of input areas when using keyboard on iOS devices
    • Enhanced handling of external iPad keyboard toolbars to prevent unwanted UI adjustments
    • Updated global background color styling for consistency

When an external keyboard is connected to iPad, Capacitor's keyboard
event fires with a small height (~55px) for the toolbar, shrinking
the entire app and leaving a visible gap at the bottom. This detects
the external keyboard toolbar (height <100px) and skips the app
shrink, letting the toolbar overlay naturally. Also adds a background
fill behind the safe area in the input positioner and sets the html
background color for full safe-area coverage.

https://claude.ai/code/session_01UBHund2513D3bvW2pjqLXo
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Feb 6, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

These changes enhance iOS keyboard interaction and visual presentation by adding a CSS background variable to the root element, conditionally rendering a background filler element in the floating input when docked, and implementing conditional keyboard detection logic to differentiate between native keyboards and external iPad toolbars.

Changes

Cohort / File(s) Summary
Global Styling
apps/web/src/app/globals.css
Added explicit background-color using CSS variable to html element in base layer.
Floating Input UI
apps/web/src/components/ui/floating-input/InputPositioner.tsx
Added aria-hidden background filler element that renders when input is docked (not centered), positioned at bottom with full width and height tied to --safe-bottom-offset CSS variable.
Keyboard Detection Logic
apps/web/src/hooks/useIOSKeyboardInit.ts
Modified keyboardWillShow handler to conditionally check keyboard height; if less than 100px (external iPad toolbar), sets --keyboard-height to 0px and skips keyboard-open class application; otherwise preserves previous behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A keyboard's height now we discern,
With iPad toolbars we don't concern,
The input floats with grace so true,
Background fillers, fresh and new,
iOS dances in iOS blue! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix iPad keyboard toolbar overlay handling' accurately and specifically summarizes the main change—addressing iPad external keyboard toolbar overlay issues—which is the central purpose of all three file modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/fix-ipad-safe-zone-1eQOM

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@2witstudios
2witstudios merged commit 9f31552 into master Feb 6, 2026
3 checks passed
@2witstudios
2witstudios deleted the claude/fix-ipad-safe-zone-1eQOM branch February 6, 2026 23:39
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