Skip to content

UX: hide keyboard accessory bar on iPhone#294

Open
chapoi wants to merge 3 commits into
mainfrom
ux-hide-keyboard-accessory-bar
Open

UX: hide keyboard accessory bar on iPhone#294
chapoi wants to merge 3 commits into
mainfrom
ux-hide-keyboard-accessory-bar

Conversation

@chapoi

@chapoi chapoi commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

On mobile, iOS/WKWebView adds a grey prev/next/Done accessory bar above the
keyboard for any focused editable region — including the composer's editor.
This hides that bar.

How it works

  • Set hideKeyboardAccessoryView={!Platform.isPad} => works globally for < iOS26
  • A patch to react-native-webview makes that setting actually take effect on iOS26:
    • Clears self.inputAssistantItem (on iOS 26 the bar is the assistant item,
      not the classic inputAccessoryView).
    • Reclasses the web content view once at startup and toggles a per-focus flag, returning the real accessory via super when not hiding. (iOS ignores mid-session class swaps, and a naive re-swap causes infinite recursion — the
      patch guards against both.)

Extra

Pod install crashed on Ruby 3.4 with cannot load such file -- kconv, because the CFPropertyList CocoaPods dependency requires kconv, which Ruby 3.4 removed from the standard library.
This change adds the nkf gem, which ships kconv.rb and restores it.

chapoi added 2 commits July 22, 2026 16:00
CocoaPods (via CFPropertyList) does require 'kconv', which Ruby 3.4 removed from the standard library, so 'pod install' crashes with 'cannot load such file -- kconv'. The nkf gem ships kconv.rb and restores it.
iOS/WKWebView shows a prev/next/Done accessory bar above the keyboard for any focused web input. Set hideKeyboardAccessoryView to hide it, gated to iPhone-class idioms (!Platform.isPad) so iPad keeps its keyboard assistant/shortcut bar.

Requires patching react-native-webview: on iOS 26 that bar is the inputAssistantItem, not the classic inputAccessoryView the library nulls out, so the stock setting is a no-op there. The patch clears self.inputAssistantItem in the reclassed content view's -inputAccessoryView. Verified on iPhone (iOS 18 and 26) and iPad simulators.
@chapoi
chapoi force-pushed the ux-hide-keyboard-accessory-bar branch from 7c69a29 to 4dffe7b Compare July 22, 2026 14:00
- UITextInputAssistantItem *inputAssistantItem = [_webView inputAssistantItem];
+ // iOS 26 renders the WKWebView keyboard bar via inputAssistantItem rather than
+ // the classic inputAccessoryView. Clear it on self (the reclassed content view)
+ // so hideKeyboardAccessoryView actually hides the bar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a known issue on the react-native-webview repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants