mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Reverted commit D3668840
Reviewed By: bestander Differential Revision: D3668840 fbshipit-source-id: 553600a06c6a97c3a653815ba6fe61aaa1dad937
This commit is contained in:
committed by
Facebook Github Bot 2
parent
5dcf7199fc
commit
db1b0e9be9
@@ -29,7 +29,6 @@ import android.text.style.BackgroundColorSpan;
|
|||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
@@ -96,24 +95,6 @@ public class ReactEditText extends EditText {
|
|||||||
mKeyListener = new InternalKeyListener();
|
mKeyListener = new InternalKeyListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Make sure multiline text input can be scrolled within a ScrollView
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
|
||||||
switch (ev.getAction()) {
|
|
||||||
case MotionEvent.ACTION_DOWN:
|
|
||||||
// Disallow ScrollView to intercept touch events.
|
|
||||||
this.getParent().requestDisallowInterceptTouchEvent(true);
|
|
||||||
break;
|
|
||||||
case MotionEvent.ACTION_UP:
|
|
||||||
// Allow ScrollView to intercept touch events.
|
|
||||||
this.getParent().requestDisallowInterceptTouchEvent(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return super.dispatchTouchEvent(ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
// After the text changes inside an EditText, TextView checks if a layout() has been requested.
|
// After the text changes inside an EditText, TextView checks if a layout() has been requested.
|
||||||
// If it has, it will not scroll the text to the end of the new text inserted, but wait for the
|
// If it has, it will not scroll the text to the end of the new text inserted, but wait for the
|
||||||
// next layout() to be called. However, we do not perform a layout() after a requestLayout(), so
|
// next layout() to be called. However, we do not perform a layout() after a requestLayout(), so
|
||||||
|
|||||||
Reference in New Issue
Block a user