Fix TextInput stack overflow when pasting text in multiline input with maxlength

Summary: When pasting text longer than maxlenght, the textDidChange: call we did would end calling back into textView:shouldChange: because we saw an unexpected multi-character change. Since this is an expected mutation, update predictedText appropriately.

Reviewed By: majak

Differential Revision: D3561524

fbshipit-source-id: 07bb78d830ccfa3aed6ee274dc30adeadce9e1f8
This commit is contained in:
Pieter De Baets
2016-07-14 07:39:18 -07:00
committed by Facebook Github Bot 1
parent 55fb4f4a75
commit 23e087fc26
2 changed files with 10 additions and 0 deletions

View File

@@ -679,6 +679,12 @@ exports.examples = [
keyboardType="url"
style={[styles.multiline, styles.multilineWithFontStyles]}
/>
<TextInput
placeholder="multiline text input with max length"
maxLength={5}
multiline={true}
style={styles.multiline}
/>
<TextInput
placeholder="uneditable multiline text input"
editable={false}