react-native/Libraries/Text
Mehdi Mulani 40e8d8904b RN TextInput: don't let user more than maxLength when TextInput already exceeds it
Summary:
We had a classic integer underflow problem here. Before we would let you type endlessly when the text already exceeded the TextInput maxLength, now we only let you erase characters.

There is still a small problem with the TextInput: how do you handle when the value (set from JS) exceeds the maxLength? This could happen pragmatically, just by passing in a very large value or when changing maxLength (e.g. when changing from 4 to 3 digits in the case of a AMEX security code -> VISA security code).

Me and achen1 discussed firing onChange in these cases and truncating the number manually (to ensure JS's data model) was aware of the change but it seemed fraught with bugs and general weirdness in what the caller would expect to happen.

Reviewed By: javache

Differential Revision: D3991210

fbshipit-source-id: dc401c4a7aefe09fa749cd1168d36343d39dc196
2016-10-18 08:13:41 -07:00
..
RCTText.xcodeproj Apple TV support 2: Xcode projects and CI (scripts/objc-test.sh) 2016-10-05 07:28:44 -07:00
RCTRawTextManager.h [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
RCTRawTextManager.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTShadowRawText.h [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
RCTShadowRawText.m Move dirty layout into css-layout 2016-07-25 03:58:41 -07:00
RCTShadowText.h Initial implementation of adjustsFontSizeToFit. 2016-08-10 11:28:37 -07:00
RCTShadowText.m Centre text in case where the distance between baselines is larger th… 2016-08-11 16:58:33 -07:00
RCTText.h Initial implementation of adjustsFontSizeToFit. 2016-08-10 11:28:37 -07:00
RCTText.m Initial implementation of adjustsFontSizeToFit. 2016-08-10 11:28:37 -07:00
RCTTextField.h Open sourced the onSelectionChange event 2015-11-14 09:44:30 -08:00
RCTTextField.m Add TextInput controlled selection prop on iOS 2016-08-25 17:28:37 -07:00
RCTTextFieldManager.h Migrated RCTText into FBReactKit 2015-07-08 07:13:00 -08:00
RCTTextFieldManager.m RN TextInput: don't let user more than maxLength when TextInput already exceeds it 2016-10-18 08:13:41 -07:00
RCTTextManager.h Add support for multiline TextInput via UITextView 2015-04-29 01:33:58 -08:00
RCTTextManager.m Include CSSLayout.h consistently with other project includes 2016-09-06 09:13:39 -07:00
RCTTextSelection.h Add TextInput controlled selection prop on iOS 2016-08-25 17:28:37 -07:00
RCTTextSelection.m Add TextInput controlled selection prop on iOS 2016-08-25 17:28:37 -07:00
RCTTextView.h Implement TextInput onContentSizeChange 2016-07-07 09:00:01 -07:00
RCTTextView.m Apple TV support 1: existing Objective C code should compile for tvOS 2016-09-27 06:28:33 -07:00
RCTTextViewManager.h Add support for multiline TextInput via UITextView 2015-04-29 01:33:58 -08:00
RCTTextViewManager.m Add TextInput controlled selection prop on iOS 2016-08-25 17:28:37 -07:00
Text.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
TextStylePropTypes.js RN: Stop Deep Linking `ReactPropTypes` 2016-10-14 18:59:10 -07:00
TextUpdateTest.js Fix up this pattern var React = require('react-native'); 2016-04-08 20:37:22 -07:00