diff --git a/package/ios/RNCSliderComponentView.mm b/package/ios/RNCSliderComponentView.mm index 605487a8..78febbf7 100644 --- a/package/ios/RNCSliderComponentView.mm +++ b/package/ios/RNCSliderComponentView.mm @@ -7,6 +7,7 @@ #import #import #import +#import #import "RCTImagePrimitivesConversions.h" #import #import "RCTFabricComponentsPlugins.h" @@ -41,6 +42,15 @@ - (instancetype)initWithFrame:(CGRect)frame static const auto defaultProps = std::make_shared(); _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:)