-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ClassCastException fix: getText() returns CharSequence not Spanned.
Summary: ClassCastException fix: getText() returns CharSequence not Spanned. From the other hand, EditTexts getText method returns Editable which extends Spanned. This commit fixes two similar bugs one in flat TextView and another in standard TextView. Also, it removes redundant checks in the ReactEditText. Application without this change sporadically crashes with the following stack trace: ``` java.lang.ClassCastException: java.lang.String cannot be cast to android.text.Spanned at com.facebook.react.views.text.ReactTextView.reactTagForTouch(ReactTextView.java:195) at com.facebook.react.uimanager.TouchTargetHelper.getTouchTargetForView(TouchTargetHelper.java:269) at com.facebook.react.uimanager.TouchTargetHelper.findTargetTagAndCoordinatesForTouch$58866680(TouchTargetHelper.java:101) at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:77) at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:151) at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:127) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110) ``` Closes #15452 Differential Revision: D6775986 Pulled By: hramos fbshipit-source-id: 6de929937cbbb3e7bd98a708a40700f883cbaef0
- Loading branch information
1 parent
f5975a9
commit 46cc490
Showing
3 changed files
with
26 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters