bug(status-bar): iOS WebView moves under the status bar after a full-screen modal is dismissed

オープン
#2,625 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@kidzki がすでに取り組んでいます。

2026年11月4日 から。

  • #2626 @kidzki による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
swift
領域
mobile-dev

調査の方向性

Read the status-bar plugin’s iOS implementation, especially resizeWebView(), handleViewDidAppear, and capacitorViewWillTransition, then compare the reported behavior with the linked pull request #2626. The issue describes the reproduction steps and expected layout; completion means the WebView returns below the status bar after a full-screen modal is dismissed. A pull request is already open, so this work is underway.

索引モデルが issue の本文から書いたものです。

説明

platform: ios

Bug Report

Plugin(s)
  • @capacitor/status-bar 8.0.4
  • @capacitor/browser 8.0.5 (used to present the full-screen modal)
Capacitor Version
Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/cli: 8.6.0
  @capacitor/core: 8.6.0
  @capacitor/ios: 8.6.0

[success] iOS looking great! 👌
Platform(s)

iOS

Current Behavior

With overlaysWebView: false, the WebView starts below the status bar after launch. After a full-screen modal is dismissed, the WebView fills the whole window again:

  • The page content sits under the status bar.
  • The status bar background view (backgroundColor) is no longer visible.
  • StatusBar.getInfo() still returns overlays: false.

The layout stays wrong until the next rotation. Rotating to landscape and back restores it.

The full-screen modal in the reproduction is Browser.open() with the default presentation style. With presentationStyle: 'popover' the layout stays correct.

Expected Behavior

After a full-screen modal is dismissed, the WebView is below the status bar again, and the status bar background view is visible, as before the modal was presented.

Code Reproduction

https://github.com/kidzki/capacitor-status-bar-repro

  1. npm install && npm run build && npx cap sync ios
  2. Run the app on an iPhone simulator. The yellow box shows RESULT: OK.
  3. Tap Open in-app browser (full screen), then close the browser.
  4. The yellow box shows RESULT: BUG: window.innerHeight equals screen.height, and the sticky header sits under the status bar.

Configuration:

"StatusBar": {
  "overlaysWebView": false,
  "backgroundColor": "#ffffff",
  "style": "LIGHT"
}
Other Technical Details
  • Observed on the iPhone 18 Pro simulator, iOS 27.2, Xcode 27.2.
  • Also observed in our app on a physical iPhone 17 Pro with iOS 26.6.4, 27.0.1 and 27.2. Our app opens Browser.open() full screen for the login.
  • The page does not use viewport-fit=cover.
  • The app shell is the unchanged ios template from npx cap add ios (Capacitor 8.6.0).
Additional Context

CAPBridgeViewController.loadView() sets view = webView, so the WebView is the root view. When a full-screen modal is dismissed, UIKit sets the root view back to the full window bounds.

The plugin positions the WebView in resizeWebView(). It calls that function after setOverlaysWebView and after a rotation (capacitorViewWillTransition). On capacitorViewDidAppear, which also fires after the modal is dismissed, handleViewDidAppear calls setOverlaysWebView(config.overlaysWebView). That function returns early because the value did not change (if overlay == isOverlayingWebview { return }), so the plugin does not lay out the WebView again.

Possible fixes:

  1. Lay out again in handleViewDidAppear. We tried this: it restores the layout, but the jump is visible because viewDidAppear fires after the dismiss animation.
  2. Observe the WebView layer (position, bounds) while overlaysWebView is false, and move the WebView back below the status bar when its origin changes. We tried this: the layout is restored without a visible jump. A pull request with this change follows.
  3. Capacitor core sends a notification from viewWillLayoutSubviews or viewWillAppear, and the plugin lays out there. Not tried.
  4. @capacitor/browser presents with .overFullScreen instead of .fullScreen, so UIKit keeps the presenting view in place. Not tried. This fixes only the browser, not other full-screen modals.
主要言語
Java
スター
688
フォーク
691
平均マージ
1日 15時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/capacitor-plugins のほかの issue

ionic-team/capacitor-plugins の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。