bug(action-sheet, camera): on iPhone with Liquid Glass, action sheets show as a popover without the Cancel action
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
- 20/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ios, swift
- Lĩnh vực
- backend-api-design, mobile
Hướng nghiên cứu
Start with ActionSheetPlugin.swift at the showActions() call to setCenteredPopover; the issue also identifies CameraPlugin.swift in showPrompt() and the core CAPPlugin.m helper. Check how the presentation anchor is set for each device idiom, then verify on iPhone and iPad: iPhone should show the Cancel action, while iPad should keep its anchored popover. Pull request #2631 is already open.
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/action-sheet8.1.1 (also present onmain,8.1.2-nightly-20261104T150902.0and9.0.0-dev-2629-20261104T204338.0)@capacitor/camera: same pattern inshowPrompt()(CameraSource.Prompt), not reproduced separately
Capacitor Version
Installed Dependencies:
@capacitor/cli: 8.6.0
@capacitor/core: 8.6.0
@capacitor/android: 8.6.0
@capacitor/ios: 8.6.0
Platform(s)
iOS on iPhone, with the Liquid Glass design.
- With
@capacitor/action-sheet: iOS 27.0 simulator and an iPhone 11 on iOS 27.0. - With the plain UIKit snippet below: iOS 26.3 and 27.0 simulators.
I haven't tested iPad. There the anchored popover is the intended presentation.
Current Behavior
ActionSheet.showActions() presents the sheet as a popover instead of the system action sheet. The popover is narrower, has no dimmed background, and has no Cancel button, even when an option has style: ActionSheetButtonStyle.Cancel.
showActions calls setCenteredPopover(alertController) on every device (ActionSheetPlugin.swift#L47). Core's setCenteredPopover (CAPPlugin.m#L149-L155) sets sourceView and sourceRect to the centre of the bridge view, with permittedArrowDirections = 0, regardless of idiom.
Without Liquid Glass, iPhone ignores that anchor. With Liquid Glass, UIKit presents an anchored .actionSheet as a popover on iPhone too, and hides the .cancel action, as it always has for popovers. The helper dates from ionic-team/capacitor#25 (2017), when the anchor only took effect on iPad.
UIDesignRequiresCompatibility = YES doesn't help when building with Xcode 27: our app sets it, yet its Xcode 27 builds use Liquid Glass and show the popover on iOS 27.
Expected Behavior
On iPhone, the system's standard (unanchored) action sheet: a wider card over a dimmed background, with its Cancel action.
The position doesn't change. On iOS 26.3 and 27.0, in an app built with Xcode 27, the system action sheet is centred too, not at the bottom of the screen as before Liquid Glass.
On iPad, the anchored popover stays as it is.
Code Reproduction
Build with Xcode 27, with or without UIDesignRequiresCompatibility, and run on an iPhone or iPhone simulator with iOS 27.
import { ActionSheet, ActionSheetButtonStyle } from '@capacitor/action-sheet';
await ActionSheet.showActions({
title: 'Photo Options',
options: [
{ title: 'Upload' },
{ title: 'Share' },
{ title: 'Cancel', style: ActionSheetButtonStyle.Cancel },
],
});
The same thing in plain UIKit, to isolate it from Capacitor:
let sheet = UIAlertController(title: "Videos", message: nil, preferredStyle: .actionSheet)
sheet.addAction(UIAlertAction(title: "From Videos", style: .default))
sheet.addAction(UIAlertAction(title: "Record", style: .default))
sheet.addAction(UIAlertAction(title: "Cancel", style: .cancel))
// What setCenteredPopover does:
sheet.popoverPresentationController?.sourceRect = CGRect(x: view.center.x, y: view.center.y, width: 0, height: 0)
sheet.popoverPresentationController?.sourceView = view
sheet.popoverPresentationController?.permittedArrowDirections = []
present(sheet, animated: true)
// iPhone with Liquid Glass: a popover without Cancel.
// Without the 3 anchor lines, or with `sourceView = nil` afterwards: the system action sheet with Cancel.
Other Technical Details
Xcode 27.0 (27A266a). iOS 26.3 and 27.0 simulator runtimes. All builds used Xcode 27 (iOS 27 SDK). Apps built with Xcode 26 without UIDesignRequiresCompatibility are likely affected too, but I haven't checked.
Additional Context
Screenshots of the UIKit snippet, from left to right:
- iOS 26.3, anchored like
setCenteredPopover - iOS 26.3, the same, then
sourceView = nil - iOS 27.0, anchored like
setCenteredPopover - iOS 27.0, the same, then
sourceView = nil
Possible fixes:
- Plugins: skip
setCenteredPopoverfor action sheets on iPhone (userInterfaceIdiom == .phone).@capacitor/camerashowPrompt()(CameraPlugin.swift#L394) needs the same change. - Or core: skip the anchor in
setCenteredPopoveron iPhone. That also covers third-party plugins that call it.
Keep the anchor on every other idiom: on iPad, presenting an action sheet without one raises an exception.
Workaround in an app: override present(_:animated:completion:) in the CAPBridgeViewController subclass, and on iPhone set popoverPresentationController?.sourceView = nil for UIAlertControllers with .actionSheet style before calling super.
No existing issue found: searched for setCenteredPopover, "action sheet" with "cancel", "popover" and "iOS 26", and "liquid glass".
- 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(status-bar): iOS WebView moves under the status bar after a full-screen modal is dismissedCó thể đã có người làm @kidzki đã nhận 2 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 25/100
ionic-team/capacitor-plugins#2625 ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
googleads/googleads-mobile-flutter#1541 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Keyboard crashes Chrome tabsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Julow/Unexpected-Keyboard#1490 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Vakore/ZappierGames#275 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
unitycatalog/unitycatalog#2148 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement priority: low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Riptide-Labs/riptide#1060 ·
Maintainer thường phản hồi trong vòng 1 ngày