Repository navigation
Commit 0bd2cb1
Fix TextInput dataDetectorTypes="all" having no effect on iOS (New Arch) (#58829)
Summary:
Fixes #55367.
On the New Architecture, `<TextInput dataDetectorTypes="all" />` has no effect on iOS, while individual types (`link`, `phoneNumber`, …) work.
`RCTUITextViewDataDetectorTypesFromStringVector` reads the mapped `NSNumber` with `unsignedIntValue`. `UIDataDetectorTypeAll` is `NSUIntegerMax`, so it gets truncated to `0x00000000ffffffff`, which is not equal to `UIDataDetectorTypeAll` and UIKit does not treat it as "all".
This switches to `unsignedIntegerValue`, matching the width of `UIDataDetectorTypes` (`NSUInteger`). The legacy `RCTConvert` path already reads the same mapping with `unsignedLongLongValue`, which is why the Old Architecture is unaffected.
## Changelog:
[IOS] [FIXED] - Fix `TextInput` `dataDetectorTypes="all"` having no effect on the New Architecture
Pull Request resolved: #58829
Test Plan:
I compiled `RCTUITextViewDataDetectorTypesFromStringVector`, copied verbatim from the file before and after this change, into a small harness against the iOS SDK (stubbing only `RCTNSStringFromString`), and ran it on an iOS 26 simulator:
```
== before
all -> 0x00000000ffffffff
link -> 0x0000000000000002
link+phoneNumber -> 0x0000000000000003
lookupSuggestion -> 0x0000000000000040
== after
all -> 0xffffffffffffffff (== UIDataDetectorTypeAll)
link -> 0x0000000000000002
link+phoneNumber -> 0x0000000000000003
lookupSuggestion -> 0x0000000000000040
```
`all` now maps to exactly `UIDataDetectorTypeAll`, and the other values are unchanged.
I did not run this end-to-end in RNTester. The issue reporter and another user ([comment](#55367)) confirmed that this same patch, applied via patch-package, fixes link detection on 0.81 and 0.86.2.
Reviewed By: javache
Differential Revision: D125664939
Pulled By: cortinico
fbshipit-source-id: a7eaf87de91216345517d517bf49a75ec8cbbb701 parent 9ae68b5 commit 0bd2cb1
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
0 commit comments