Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Text ellipsizeMode="clip" crashes on Android #18474

Closed
3 tasks done
borisyankov opened this issue Mar 20, 2018 · 11 comments
Closed
3 tasks done

Android: Text ellipsizeMode="clip" crashes on Android #18474

borisyankov opened this issue Mar 20, 2018 · 11 comments
Labels
Help Wanted :octocat: Issues ideal for external contributors. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@borisyankov
Copy link

Environment

Environment:
OS: macOS High Sierra 10.13.3
Node: 9.0.0
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4408382

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: ^0.54.2 => 0.54.2

Steps to Reproduce

  • Use a <Text /> component
  • Set ellipsizeMode to "clip"

Expected Behavior

While the documentation clearly states clip is working only for iOS I assumed this will have no effect on Android.

Actual Behavior

Causes an exception manifesting as a crash inside the app:
RuntimeException com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'ellipsizeMode' of a view managed by: RCTText

com.facebook.react.bridge.ReactContext in handleException at line 313
com.facebook.react.uimanager.GuardedFrameCallback in doFrame at line 33
com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher in doFrame at line 136
com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1 in doFrame at line 107
android.view.Choreographer$CallbackRecord in run at line 909
android.view.Choreographer in doCallbacks at line 723
android.view.Choreographer in doFrame at line 655
android.view.Choreographer$FrameDisplayEventReceiver in run at line 897
android.os.Handler in handleCallback at line 790
android.os.Handler in dispatchMessage at line 99
android.os.Looper in loop at line 164
android.app.ActivityThread in main at line 6494
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 438
com.android.internal.os.ZygoteInit in main at line 807
@react-native-bot react-native-bot added the Platform: Android Android applications. label Mar 20, 2018
@hramos
Copy link
Contributor

hramos commented Mar 20, 2018

We should make this clearer in the docs. Can you open an issue at https://github.com/facebook/react-native-website instead?

Closing as clip is a iOS-only prop.

@hramos hramos closed this as completed Mar 20, 2018
@hramos hramos added the Type: Docs Issues concerning the docs are tracked elsewhere: https://github.com/facebook/react-native-website label Mar 20, 2018
@borisyankov
Copy link
Author

borisyankov commented Mar 20, 2018

I strongly disagree. This is not a documentation issue.
Setting a property on a component should not crash the app.

@hramos
Copy link
Contributor

hramos commented Mar 21, 2018

Let us know if you have a PR that changes this behavior.

@hramos hramos reopened this Mar 21, 2018
@hramos hramos added Help Wanted :octocat: Issues ideal for external contributors. and removed Type: Docs Issues concerning the docs are tracked elsewhere: https://github.com/facebook/react-native-website labels Mar 21, 2018
t4deu added a commit to t4deu/react-native that referenced this issue Mar 24, 2018
Fixes facebook#18474

Applies the default behavior if the ellipsize mode is set
to "clip", since it's only supported by IOS
@t4deu
Copy link
Contributor

t4deu commented Mar 24, 2018

Hi there! I just sent a PR with the fix for this issue, hope it helps!

@borisyankov
Copy link
Author

@t4deu maybe just ignoring the property is the more 'expected' behavior.

@t4deu
Copy link
Contributor

t4deu commented Mar 25, 2018

Hi @borisyankov, the default tail is applied even if the value be ignored, I think the change just made the result more explicit instead of another if else block. But we can change that 😉.

t4deu added a commit to t4deu/react-native that referenced this issue Mar 25, 2018
Fixes facebook#18474

Summary:

This allows use clip as ellipsize mode for truncated text on android
hamaron pushed a commit to hamaron/react-native that referenced this issue Apr 9, 2018
Summary:
Fixes facebook#18474

This allows use clip as ellipsize mode for truncated text on android

Added a test to RNTester, so it can be tested from there:
1. Run RNTester project
2. Navigate to `<Text>` tests
3. Scroll down to "Ellipsize mode" examples
4. Check the default behavior being applied when the value is set to "clip"

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [Text] - Prevents android crash due to unsupported "clip" ellipsize mode

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes facebook#18540

Differential Revision: D7396379

Pulled By: mdvacca

fbshipit-source-id: 6c4b223731143c5081b3d12a3c740d1e375bd586
campsafari pushed a commit to exozet/react-native that referenced this issue Apr 11, 2018
Summary:
Fixes facebook#18474

This allows use clip as ellipsize mode for truncated text on android

Added a test to RNTester, so it can be tested from there:
1. Run RNTester project
2. Navigate to `<Text>` tests
3. Scroll down to "Ellipsize mode" examples
4. Check the default behavior being applied when the value is set to "clip"

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [Text] - Prevents android crash due to unsupported "clip" ellipsize mode

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes facebook#18540

Differential Revision: D7396379

Pulled By: mdvacca

fbshipit-source-id: 6c4b223731143c5081b3d12a3c740d1e375bd586
LukeDurrant pushed a commit to LukeDurrant/react-native that referenced this issue Apr 11, 2018
Summary:
Fixes facebook#18474

This allows use clip as ellipsize mode for truncated text on android

Added a test to RNTester, so it can be tested from there:
1. Run RNTester project
2. Navigate to `<Text>` tests
3. Scroll down to "Ellipsize mode" examples
4. Check the default behavior being applied when the value is set to "clip"

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [Text] - Prevents android crash due to unsupported "clip" ellipsize mode

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes facebook#18540

Differential Revision: D7396379

Pulled By: mdvacca

fbshipit-source-id: 6c4b223731143c5081b3d12a3c740d1e375bd586
LukeDurrant pushed a commit to LukeDurrant/react-native that referenced this issue Apr 11, 2018
Summary:
Fixes facebook#18474

This allows use clip as ellipsize mode for truncated text on android

Added a test to RNTester, so it can be tested from there:
1. Run RNTester project
2. Navigate to `<Text>` tests
3. Scroll down to "Ellipsize mode" examples
4. Check the default behavior being applied when the value is set to "clip"

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [Text] - Prevents android crash due to unsupported "clip" ellipsize mode

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes facebook#18540

Differential Revision: D7396379

Pulled By: mdvacca

fbshipit-source-id: 6c4b223731143c5081b3d12a3c740d1e375bd586
bunnyc1986 pushed a commit to bunnyc1986/react-native that referenced this issue May 11, 2018
Summary:
Fixes facebook#18474

This allows use clip as ellipsize mode for truncated text on android

Added a test to RNTester, so it can be tested from there:
1. Run RNTester project
2. Navigate to `<Text>` tests
3. Scroll down to "Ellipsize mode" examples
4. Check the default behavior being applied when the value is set to "clip"

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [Text] - Prevents android crash due to unsupported "clip" ellipsize mode

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes facebook#18540

Differential Revision: D7396379

Pulled By: mdvacca

fbshipit-source-id: 6c4b223731143c5081b3d12a3c740d1e375bd586
macdoum1 pushed a commit to macdoum1/react-native that referenced this issue Jun 28, 2018
Summary:
Fixes facebook#18474

This allows use clip as ellipsize mode for truncated text on android

Added a test to RNTester, so it can be tested from there:
1. Run RNTester project
2. Navigate to `<Text>` tests
3. Scroll down to "Ellipsize mode" examples
4. Check the default behavior being applied when the value is set to "clip"

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [Text] - Prevents android crash due to unsupported "clip" ellipsize mode

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes facebook#18540

Differential Revision: D7396379

Pulled By: mdvacca

fbshipit-source-id: 6c4b223731143c5081b3d12a3c740d1e375bd586
@codler
Copy link
Contributor

codler commented Jul 2, 2018

Is this fixed? I still get error

Environment:
OS: macOS High Sierra 10.13.5
Node: 8.9.4
Yarn: 1.6.0
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

@hramos
Copy link
Contributor

hramos commented Jul 2, 2018

@codler it was fixed in master three months ago. You’re using 0.55 which does not have this fix. Try the 0.56 release.

@codler
Copy link
Contributor

codler commented Jul 2, 2018

@hramos When is 0.56 going to be released?

@dulmandakh
Copy link
Contributor

dulmandakh commented Jul 2, 2018 via email

@hramos
Copy link
Contributor

hramos commented Jul 2, 2018

@codler 0.56 was released last month. It is scheduled to hit stable today: https://github.com/facebook/react-native/blob/master/Releases.md#release-schedule

@facebook facebook locked as resolved and limited conversation to collaborators Mar 26, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted :octocat: Issues ideal for external contributors. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants