Skip to content
Open
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
10 changes: 10 additions & 0 deletions package/ios/RNCSliderComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#import <react/renderer/components/RNCSlider/Props.h>
#import <react/renderer/components/RNCSlider/RCTComponentViewHelpers.h>
#import <React/RCTBridge+Private.h>
#import <React/RCTI18nUtil.h>
#import "RCTImagePrimitivesConversions.h"
#import <React/RCTImageLoaderProtocol.h>
#import "RCTFabricComponentsPlugins.h"
Expand Down Expand Up @@ -41,6 +42,15 @@ - (instancetype)initWithFrame:(CGRect)frame
static const auto defaultProps = std::make_shared<const RNCSliderProps>();
_props = defaultProps;
slider = [[RNCSlider alloc] initWithFrame:self.bounds];

// Honor app-forced RTL (RCTI18nUtil) instead of device locale
BOOL appIsRTL = [[RCTI18nUtil sharedInstance] isRTL];
UISemanticContentAttribute attr = appIsRTL
? UISemanticContentAttributeForceRightToLeft
: UISemanticContentAttributeForceLeftToRight;
slider.semanticContentAttribute = attr;
self.semanticContentAttribute = attr;

[slider addTarget:self action:@selector(sliderValueChanged:)
forControlEvents:UIControlEventValueChanged];
[slider addTarget:self action:@selector(sliderTouchStart:)
Expand Down