react-native/Examples
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
..
2048 Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
Movies Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
TicTacToe Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
UIExplorer RN TextInput: don't let user more than maxLength when TextInput already exceeds it 2016-10-18 08:13:41 -07:00
.eslintrc Add global flow types to eslint globals 2016-01-27 15:55:34 -08:00