Description
The changesSelectionAsPrimaryAction for the new header bar buttons API has a bug in the code that only sets it for tvOS:
#if !TARGET_OS_TV || __TV_OS_VERSION_MAX_ALLOWED >= 170000
if (@available(tvOS 17.0, *)) {
NSNumber *changesSelectionAsPrimaryActionNum = dict[@"changesSelectionAsPrimaryAction"];
if (changesSelectionAsPrimaryActionNum != nil) {
self.changesSelectionAsPrimaryAction = [changesSelectionAsPrimaryActionNum boolValue];
}
}
#endif
It is obviously supported on all platforms though: https://developer.apple.com/documentation/UIKit/UIButton/changesSelectionAsPrimaryAction
Also in the library author guide it says iOS 15+: https://github.com/software-mansion/react-native-screens/blob/3d452928163987ed0fb9818c59f006ec38bc5276/guides/GUIDE_FOR_LIBRARY_AUTHORS.md#the-button-with-a-menu-also-support
Steps to reproduce
Try to set changesSelectionAsPrimaryAction, observe it does not work for other platforms than tvOS.
Snack or a link to a repository
|
if (@available(tvOS 17.0, *)) { |
Screens version
4.23.0
React Native version
0.83.2
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Fabric (New Architecture)
Build type
Release mode
Device
Real device
Device model
iPhone 17
Acknowledgements
Yes
Description
The
changesSelectionAsPrimaryActionfor the new header bar buttons API has a bug in the code that only sets it for tvOS:It is obviously supported on all platforms though: https://developer.apple.com/documentation/UIKit/UIButton/changesSelectionAsPrimaryAction
Also in the library author guide it says iOS 15+: https://github.com/software-mansion/react-native-screens/blob/3d452928163987ed0fb9818c59f006ec38bc5276/guides/GUIDE_FOR_LIBRARY_AUTHORS.md#the-button-with-a-menu-also-support
Steps to reproduce
Try to set
changesSelectionAsPrimaryAction, observe it does not work for other platforms than tvOS.Snack or a link to a repository
react-native-screens/ios/RNSBarButtonItem.mm
Line 78 in 3d45292
Screens version
4.23.0
React Native version
0.83.2
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Fabric (New Architecture)
Build type
Release mode
Device
Real device
Device model
iPhone 17
Acknowledgements
Yes