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

Text component android_hyphenationFrequency type is incomplete #33104

Closed
ospfranco opened this issue Feb 14, 2022 · 6 comments
Closed

Text component android_hyphenationFrequency type is incomplete #33104

ospfranco opened this issue Feb 14, 2022 · 6 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Needs: Triage 🔍 Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@ospfranco
Copy link
Contributor

Description

Current prop is missing the high value on the flow types:

// Libraries/Text/TextProps.js
/**
   * Set hyphenation strategy on Android.
   *
   */
  android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),

should be:

  android_hyphenationFrequency?: ?('normal' | 'none' | 'full' | 'high')

Version

0.67.2

Output of npx react-native info

System:
OS: macOS 12.1
CPU: (8) arm64 Apple M1
Memory: 90.97 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.12.0 - ~/.nvm/versions/node/v16.12.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.12.0/bin/yarn
npm: 8.1.0 - ~/.nvm/versions/node/v16.12.0/bin/npm
Watchman: 2022.01.31.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/osp/.gem/ruby/2.7.2/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK:
API Levels: 30, 32
Build Tools: 30.0.2, 32.0.0
System Images: android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7935034
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.2 => 0.67.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

It's just a flow-type error (I think)

Snack, code example, screenshot, or link to a repository

No response

@cortinico
Copy link
Contributor

Do you want to try submitting a PR?

@cortinico cortinico added the Good first issue Interested in collaborating? Take a stab at fixing one of these issues. label Feb 16, 2022
@ospfranco
Copy link
Contributor Author

I might submit one later if I get some free time at work.

@steffenkleinle
Copy link

steffenkleinle commented Feb 17, 2022

According to the full changelog of v0.67.0 high and balanced were removed as possible values for android_hyphenationFrequency: https://github.com/facebook/react-native/blob/main/CHANGELOG.md#android-specific-3 (6th bullet point). Corresponding commit: a0d30b8

It seems like the docs did just not get adjusted.

Explanation:

hyphenationStrategy must be one of one of Layout#HYPHENATION_FREQUENCY_NONE, Layout#HYPHENATION_FREQUENCY_NORMAL, Layout#HYPHENATION_FREQUENCY_FULL: (https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int))

Thus "high" and "balanced" are not only redundant, but actually don't do what the value indicates - Layout#BREAK_STRATEGY_BALANCED (constant value: 2) and Layout#BREAK_STRATEGY_HIGH_QUALITY (constant value: 1) are only meant to be used for android:breakStrategy

There is also currently a bug breaking the hyphenation with soft hyphens (\u00AD/­): #31878

@yslDevelop
Copy link

Hello, I'm new to the open source contributing.
if it's still need help, can I jump on it?
thanks

@cortinico
Copy link
Contributor

Why was this closed @ospfranco ?

@ospfranco
Copy link
Contributor Author

The comment by klinzo explained it, the functionality has been removed, adding the types won't solve it

@facebook facebook locked as resolved and limited conversation to collaborators Mar 24, 2023
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Needs: Triage 🔍 Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants