Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Taps hit the wrong location after rotation on iPhone Duo when SwiftUI `Map` fills screen by setting .ignoresSafeArea()

Đang mở
#2,452 0 bình luận 6 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
ios, swift
Lĩnh vực
frontend, mobile

Hướng nghiên cứu

Start by reproducing the issue with a full-screen SwiftUI Map using .ignoresSafeArea() on an iPhone Duo, then compare behavior after rotation with .ignoresSafeArea(.all, edges: .vertical). The report names Mapbox 11.33.1 and TapInteraction, but no source files or tests; trace how rotation and safe-area changes affect map gesture hit-testing. Done means taps resolve at the touched feature after rotation and single-finger pans remain pans.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

auto-triaged bug :beetle: p3 SwiftUI
  • Device: iPhone Duo.
  • iOS: 27.0
  • Mapbox 11.33.1

The setup

The SwiftUI Map is used full-screen (.ignoresSafeArea()), edge to edge, under the status bar and home indicator. It makes use of a symbol layer that registers tap using TapInteraction

Swift

MapReader { proxy in
    Map(viewport: $viewport) {
        // sources / layers
        TapInteraction { context in
            // select the tapped charger feature
            return true
        }
    }
    .presentationTransactionMode(.async)
    .ignoresSafeArea()
}

The issue

  1. Open the app on an iPhone Duo in any orientation. Tapping features works.

  2. Rotate the device.

  3. Taps on features now resolve to the wrong place. A tap about one sidebar-width to the right of a feature opens that feature, and tapping the feature itself does nothing. The offset seems to match the width of the system sidebar when it is shown, however I haven't tested this extensively.

  4. Rotating back doesn't fix it.

  5. Single-finger pans sometimes behave like zoom gestures.

  6. The only recovery is to force quit the app.

Removing .ignoresSafeArea() from the Map makes the problem go away.

Hypothesis

On the iPhone Duo the sidebar is reported as a leading safe-area inset. With .ignoresSafeArea() the map view extends underneath the sidebar. After rotation, the safe-area insets seem to change, but the map's frame or origin used for gesture and feature hit-testing is not updated. Taps are then resolved at points shifted by roughly the sidebar's width. We have not confirmed this in the SDK.

Trying out .ignoresSafeArea(.all, edges: .vertical), seems to fix the issue which suggests that it is caused by the sidebar.

Expected: Taps resolve at the touched point, independent of safe-area or sidebar changes.

Actual: Taps resolve offset by about the sidebar width after rotation.

Ngôn ngữ chính
Swift
Star
601
Fork
198
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mapbox/mapbox-maps-ios

Tất cả issue của mapbox/mapbox-maps-ios

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.