Skip to content

feat(hit-testing): add allowsHitTesting modifier - #1151

Merged
Kyle-Ye merged 2 commits into
mainfrom
feature/allows_hit_test
Oct 15, 2026
Merged

Kyle-Ye merged 2 commits into
mainfrom
feature/allows_hit_test

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Implement View.allowsHitTesting(_:) with the public _AllowsHitTestingModifier renderer effect, replacing the pass-through placeholder.
  • Mark the display list content of a view that disallows hit testing to ignore events.
  • Exclude the view and its subtree from responder hit testing through a dedicated responder and filter.
  • Remove the view from the large content viewer tree when hit testing is disabled.

Add _AllowsHitTestingModifier and View.allowsHitTesting(_:). When hit
testing is disabled, the view and its subtree receive no hit tests,
its display list content ignores events, and it is removed from the
large content viewer tree.
@github-actions github-actions Bot added area: accessibility Accessibility APIs, settings, semantics, or behavior. area: event-gesture Events, gestures, tracing, or interaction plumbing. area: view View APIs, modifiers, AnyView, ForEach, DynamicView, and related behavior. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 15, 2026
@tuist

tuist Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 cc09fb458

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 59.9s cc09fb458

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.53%. Comparing base (3eb296a) to head (f8c92e8).

Files with missing lines Patch % Lines
...iftUI/Event/HitTest/AllowsHitTestingModifier.swift 0.00% 33 Missing ⚠️
.../Accessibility/AccessibilityLargeContentView.swift 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1151      +/-   ##
==========================================
- Coverage   29.58%   29.53%   -0.05%     
==========================================
  Files         939      939              
  Lines       74407    74448      +41     
==========================================
- Hits        22010    21990      -20     
- Misses      52397    52458      +61     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Kyle-Ye merged commit 9fc3559 into main Oct 15, 2026
6 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/allows_hit_test branch October 15, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: accessibility Accessibility APIs, settings, semantics, or behavior. area: event-gesture Events, gestures, tracing, or interaction plumbing. area: view View APIs, modifiers, AnyView, ForEach, DynamicView, and related behavior. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant