Skip to content

Fix TextInput dataDetectorTypes="all" having no effect on iOS (New Arch) - #58829

Closed
Cedric921 wants to merge 1 commit into
react:mainfrom
Cedric921:fix/ios-textinput-datadetectortypes-all
Closed

Cedric921 wants to merge 1 commit into
react:mainfrom
Cedric921:fix/ios-textinput-datadetectortypes-all

Conversation

@Cedric921

Copy link
Copy Markdown
Contributor

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

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) confirmed that this same patch, applied via patch-package, fixes link detection on 0.81 and 0.86.2.

RCTUITextViewDataDetectorTypesFromStringVector read the mapped value with
unsignedIntValue, truncating UIDataDetectorTypeAll (NSUIntegerMax) to
0xffffffff, so UITextView did not treat it as "all". Use
unsignedIntegerValue to match the full width of UIDataDetectorTypes, as the
legacy RCTConvert path already does (unsignedLongLongValue).

Fixes react#55367
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 4, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 4, 2026
@meta-codesync

meta-codesync Bot commented Oct 16, 2026

Copy link
Copy Markdown

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D125664939.

@meta-codesync meta-codesync Bot closed this in 0bd2cb1 Oct 16, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @Cedric921 in 0bd2cb1

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 16, 2026
@meta-codesync

meta-codesync Bot commented Oct 16, 2026

Copy link
Copy Markdown

@cortinico merged this pull request in 0bd2cb1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IOS][New Arch] TextInput dataDetectorTypes has no effect when set to all

2 participants