bug(status-bar): iOS WebView moves under the status bar after a full-screen modal is dismissed
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- swift
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
Plugin(s)
@capacitor/status-bar8.0.4@capacitor/browser8.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 returnsoverlays: 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
npm install && npm run build && npx cap sync ios- Run the app on an iPhone simulator. The yellow box shows
RESULT: OK. - Tap Open in-app browser (full screen), then close the browser.
- The yellow box shows
RESULT: BUG:window.innerHeightequalsscreen.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
iostemplate fromnpx 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:
- Lay out again in
handleViewDidAppear. We tried this: it restores the layout, but the jump is visible becauseviewDidAppearfires after the dismiss animation. - Observe the WebView layer (
position,bounds) whileoverlaysWebViewisfalse, 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. - Capacitor core sends a notification from
viewWillLayoutSubviewsorviewWillAppear, and the plugin lays out there. Not tried. @capacitor/browserpresents with.overFullScreeninstead of.fullScreen, so UIKit keeps the presenting view in place. Not tried. This fixes only the browser, not other full-screen modals.
- Ngôn ngữ chính
- Java
- Star
- 688
- Fork
- 691
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ionic-team/capacitor-plugins
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
ionic-team/capacitor-plugins#2627 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ionic-team/capacitor-plugins#2616 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[@capacitor/app] iOS: 'Expression implicitly coerced from String? to Any' warning in getAppLanguageĐang mởtriage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
ionic-team/capacitor-plugins#2604 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(action-sheet, camera): on iPhone with Liquid Glass, action sheets show as a popover without the Cancel actionCó thể đã có người làm @arblitroshani đã nhận 3 ngày trước. Đang mởplatform: ios
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
ionic-team/capacitor-plugins#2630 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
platform: ios
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ionic-team/capacitor-plugins#2624 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ionic-team/capacitor-plugins
Issue tương tự
-
Document and enforce pull request review guidelinesCó thể đã có người làm @dashorst đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
hermes-queue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
chrisalunlloyd2-sudo/mindpalace#349 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Retry-After parser accepts invalid delay-seconds valuesCó thể đã có người làm @Dhruvraj-Rana đã nhận hôm nay. Đang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
open-telemetry/opentelemetry-java#9018 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
dropwizard-testing: DAOTest.inTransaction leaves the transaction open when an Error is thrownĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dropwizard/dropwizard#11410 ·
Maintainer thường phản hồi trong vòng 1 ngày