-
Notifications
You must be signed in to change notification settings - Fork 312
fix(ios): Set delegate properly in new architecture to resolve question marks display issue #640
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(ios): Set delegate properly in new architecture to resolve question marks display issue #640
Conversation
- Fixes issue where picker delegate was not set in RCT_NEW_ARCH_ENABLED builds - Resolves question marks appearing instead of picker values on iOS - Ensures delegate is properly initialized for both old and new architecture Fixes react-native-picker#639
|
@Doug821 tried this fix on 80.1, but when I open the picker i'm getting an error |
…ctures - Remove RCT_NEW_ARCH_ENABLED conditional for textColor assignment - Always use RCTConvert UIColor to properly convert textColor values - Simplify delegate assignment in initWithFrame (works same in both archs) - Refactor initWithFrame to use modern early return pattern Fixes crash: "-[__NSCFNumber _isDynamic]: unrecognized selector sent to instance" caused by passing unconverted NSNumber values directly to UIColor properties in new architecture.
@mikebouwmans Thanks for testing! I managed to reproduce the issue you reported. The issue was that in the new architecture, we were passing raw label.textColor =
#ifdef RCT_NEW_ARCH_ENABLED
_items[row][@"textColor"] // Raw value - could be NSNumber!
#else
[RCTConvert UIColor:_items[row][@"textColor"]] // Properly converted
#endif
?: _color;When This PR unifies the behavior by always using label.textColor = [RCTConvert UIColor:_items[row][@"textColor"]] ?: _color;Could you please retry with the latest changes? The |
|
@Doug821 Awesome now seems to work correctly! |
|
@Doug821
|
Naturalclar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
## [2.11.4](v2.11.3...v2.11.4) (2025-10-15) ### Bug Fixes * **ios:** Set delegate properly in new architecture to resolve question marks display issue ([#640](#640)) ([0096a16](0096a16))
|
🎉 This PR is included in version 2.11.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Fixes an issue where the iOS picker displays question marks (?) instead of actual item labels when using React Native's new architecture (Fabric).
Problem
In React Native 0.80.x with the new architecture enabled, the picker delegate was not being properly set, causing the picker to display question marks instead of the actual item labels. This only affected iOS - Android worked fine.
Root Cause
The
RCT_NEW_ARCH_ENABLEDcode path had a comment// nothinginstead of properly setting the delegate, while the legacy architecture path correctly setself.delegate = self.Solution
Added the missing
self.delegate = self;assignment in theRCT_NEW_ARCH_ENABLEDcode path to match the behavior of the legacy architecture.Changes
ios/RNCPicker.mm// nothingcomment withself.delegate = self;in the new architecture initializationTesting
Closes
Fixes #639
Checklist