Skip to content

Commit c7dc019

Browse files
Better Approach
1 parent d682cf6 commit c7dc019

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ - (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range
451451
}
452452
}
453453

454-
if (props.maxLength != std::numeric_limits<int>::max()) {
454+
if (props.maxLength < std::numeric_limits<int>::max()) {
455455
NSInteger allowedLength = props.maxLength - _backedTextInputView.attributedText.string.length + range.length;
456456

457457
if (allowedLength > 0 && text.length > allowedLength) {

0 commit comments

Comments
 (0)