Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: visionOS builds #861

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ios/RNCPagerScrollView.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ NOTE: This file is *not* currently used, for context see:
- https://github.com/callstack/react-native-pager-view/pull/783#discussion_r1410295171
- https://github.com/callstack/react-native-pager-view/pull/783#discussion_r1410316201
*/
#include <UIKit/UIKit.h>

@interface RNCPagerScrollView : UIScrollView <UIGestureRecognizerDelegate>
@end
2 changes: 2 additions & 0 deletions ios/RNCPagerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ NS_ASSUME_NONNULL_BEGIN

@property(nonatomic) NSInteger initialPage;
@property(nonatomic) NSString* orientation;
#if !TARGET_OS_VISION
@property(nonatomic, readonly) UIScrollViewKeyboardDismissMode dismissKeyboard;
#endif
@property(nonatomic, copy) RCTDirectEventBlock onPageSelected;
@property(nonatomic, copy) RCTDirectEventBlock onPageScroll;
@property(nonatomic, copy) RCTDirectEventBlock onPageScrollStateChanged;
Expand Down
4 changes: 4 additions & 0 deletions ios/RNCPagerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ @implementation RNCPagerView {
- (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher {
if (self = [super init]) {
_initialPage = 0;
#if !TARGET_OS_VISION
_dismissKeyboard = UIScrollViewKeyboardDismissModeNone;
#endif
_coalescingKey = 0;
_eventDispatcher = eventDispatcher;
_orientation = @"horizontal";
Expand Down Expand Up @@ -89,11 +91,13 @@ - (void)shouldScroll:(BOOL)scrollEnabled {
}
}

#if !TARGET_OS_VISION
- (void)shouldDismissKeyboard:(NSString *)dismissKeyboard {
_dismissKeyboard = [dismissKeyboard isEqual: @"on-drag"] ?
UIScrollViewKeyboardDismissModeOnDrag : UIScrollViewKeyboardDismissModeNone;
self.scrollView.keyboardDismissMode = _dismissKeyboard;
}
#endif

#pragma mark - Internal methods

Expand Down
Loading