@craft-native/ios 0.0.180 → 0.0.181

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craft-native/ios",
3
- "version": "0.0.180",
3
+ "version": "0.0.181",
4
4
  "homepage": "https://github.com/craft-native/craft/tree/main/packages/ios#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1296,6 +1296,22 @@ private class CraftNativeFlowView: UIStackView {
1296
1296
  }
1297
1297
  }
1298
1298
 
1299
+ // MARK: Touches
1300
+
1301
+ /// A child drawn outside this view's bounds still takes its touches, as an
1302
+ /// overflowing element is clickable on the web, unless the view clips
1303
+ /// (`overflow: hidden`). UIKit only asks a view's children when the point
1304
+ /// is inside the view, so a floating button absolutely positioned out of a
1305
+ /// zero-height parent (a component's wrapper) drew but could not be tapped.
1306
+ override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
1307
+ if let hit = super.hitTest(point, with: event) { return hit }
1308
+ guard !clipsToBounds, !isHidden, alpha > 0.01, isUserInteractionEnabled else { return nil }
1309
+ for child in subviews.reversed() where !child.isHidden && child.alpha > 0.01 && child.isUserInteractionEnabled {
1310
+ if let hit = child.hitTest(child.convert(point, from: self), with: event) { return hit }
1311
+ }
1312
+ return nil
1313
+ }
1314
+
1299
1315
  // MARK: Children
1300
1316
 
1301
1317
  override var arrangedSubviews: [UIView] { flowChildren }