Commit Graph

7 Commits

Author SHA1 Message Date
Valentin Shergin 603cc48ceb TextInput: Refined contentSize calculation
Summary: This fixes pretty bad issue when contentSize is calculated based on an intrinsic horizontal (width) limitation, not on a real/current horizontal (width) one.

Reviewed By: mmmulani

Differential Revision: D5422114

fbshipit-source-id: 0eb582aeb59d29530990d4faabf2f41baa79c058
2017-07-18 14:46:22 -07:00
Valentin Shergin a50c9c8e22 TextInput: `selection` property was unified
Summary:
This diff unifies `selection` prop between single line and multi line text inputs.
Besides that, this diff improves the selection event handling, makes it more robust and predictable.
(See inline comments.)

Reviewed By: mmmulani

Differential Revision: D5317652

fbshipit-source-id: db5b0d2c0b80268e479ba866980e14b444079386
2017-07-18 14:46:22 -07:00
Valentin Shergin ee9697e515 Introducing `RCTBackedTextInputDelegate`
Summary:
Nothing behavioral changed in this diff; just moving code around.

`RCTBackedTextInputDelegate` is the new protocol which supposed to be common determinator among of UITextFieldDelegate and UITextViewDelegate
(and bunch of events and notifications around UITextInput and UITextView).

We need this reach two goals in the future:
 * Incapsulate UIKit imperfections related hack in dedicated protocol adapter. So, doing this we can fix more UIKit related bugs without touching real RN text handling logic. (Yes, we still have a bunch of bugs, which we cannot fix because it is undoable with the current architecture. This diff does NOT fix anything though.)
 * We can unify logic in RCTTextField and RCTTextView (even more!), moving it to a superclass. If we do so, we can fix another bunch of bugs related to RN imperfections. And have singleline/multiline inputs implementations even more consistent.

Reviewed By: mmmulani

Differential Revision: D5296041

fbshipit-source-id: 318fd850e946a3c34933002a6bde34a0a45a6293
2017-07-18 14:46:22 -07:00
Valentin Shergin 0fd061ec3d New (actually old) way to make RCTUITextField editable/non-editable
Reviewed By: mmmulani, sahrens

Differential Revision: D5368181

fbshipit-source-id: 9580adb4980e758fba2bf4ee4460eaaa6823358a
2017-07-03 21:22:37 -07:00
Valentin Shergin 719f0005f6 `editable` property was implemented for RCTUITextField
Summary: `UITextField` surprisingly does not have `editable` property (only UITextView does), so we have to implement it ourselfs.

Reviewed By: javache

Differential Revision: D5153070

fbshipit-source-id: 5a76c623fc5c7c3eec10c600c942cf82c93833cd
2017-06-27 16:22:44 -07:00
Valentin Shergin 44310da324 TextInput: Fixed `textWasPaste` prop for singleline TextInput
Summary: This regression was recently introduced when RCTTextField was splitted into two classes.

Reviewed By: mmmulani

Differential Revision: D5313055

fbshipit-source-id: 1027ddeed7ea9a4bf6f30b0182092f42588b83e3
2017-06-23 14:16:43 -07:00
Valentin Shergin e13b9c6e49 RCTTextField was spliited into two classes
Summary:
Motivation:
 * We maintain two different implementation of <TextInput> (multilined and singlelined), this change makes the implementations much similar which will help us to support and improve both of them in the (near) future;
 * We have to have separated RCTView-based container view for (TextField) to support sofisticated bordering and so on;
 * It opens to us possibility to unify UITextView and UITextField subclasses and remove code duplication across RCTTextView and RCTTextField;
 * Making things decoupled in general will allow us to fix existing bugs with events.

Reviewed By: mmmulani

Differential Revision: D5083010

fbshipit-source-id: 2f2d42c2244d2b39256c51480c1f16f4e3947c01
2017-05-29 16:01:11 -07:00