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

Fix - ProgressBar crashes app in new arch on android #4568

Conversation

mmuminovic
Copy link

@mmuminovic mmuminovic commented Nov 29, 2024

Motivation

In new arch android, ProgressBar crashes app when long length float value is used in progress

Error log: Warning: Error: Exception in HostFunction: Loss of precision during arithmetic conversion: (long) 33.33333333333333

So I did a fix and now we can't have long decimal numbers in accessibilityValue

Related issue

#4544

Test plan

To reproduce a bug put in ProgressBar prop progress={0.07}

0.07*100 in JS is equal to 7.000000000000001

and that was my case.

I tested using dependencies:
"expo": "^52.0.0",
"react-native": "0.76.3",
"react-native-paper": "^5.12.5"

Everything works fine now

@callstack-bot
Copy link

Hey @mmuminovic, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@BogiKay
Copy link
Contributor

BogiKay commented Nov 29, 2024

@mmuminovic Thank you very much for your effort!

Expected type of now is integer, so your solution won't work, because the result is float.

The fix for this issue is already implemented as part of new-arch support work, so there's no need to make any changes on your end.

@BogiKay BogiKay closed this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants