Skip to content

Commit

Permalink
Make MMMStackContainer pass taps through, just like other containers
Browse files Browse the repository at this point in the history
This is handy when these containers are used within floating headers/footers,
where we want to be able to scroll by dragging the header/footer itself, while
there still can be other tappable elements, so disabling user interactions for
the whole header/footer is not feasible.
  • Loading branch information
aleh committed Oct 31, 2023
1 parent bf7315a commit 007c1f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MMMCommonUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Pod::Spec.new do |s|

s.name = "MMMCommonUI"
s.version = "3.11.0"
s.version = "3.11.1"
s.summary = "Small UI-related pieces reused in many components from MMMTemple"
s.description = "#{s.summary}."
s.homepage = "https://github.com/mediamonks/#{s.name}"
Expand Down
10 changes: 10 additions & 0 deletions Sources/MMMCommonUIObjC/MMMLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,16 @@ - (void)setSubviews:(NSArray<UIView *> *)subviews {
}
}

// Just like other containers, this should be passing taps through.
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView *view = [super hitTest:point withEvent:event];
if (view == self) {
return nil;
} else {
return view;
}
}

@end

//
Expand Down

0 comments on commit 007c1f8

Please sign in to comment.