Fix crash on Compose 1.7; Update dependencies#67
Open
dhritzkiv wants to merge 9 commits intojump-sdk:masterfrom
Open
Fix crash on Compose 1.7; Update dependencies#67dhritzkiv wants to merge 9 commits intojump-sdk:masterfrom
dhritzkiv wants to merge 9 commits intojump-sdk:masterfrom
Conversation
Version 2 usage as described here: https://developer.android.com/develop/ui/compose/compiler Update kotlin Update kotlinc
|
|
Thanks for the fix my dude |
adrianegraphene
approved these changes
Dec 29, 2024
adrianegraphene
left a comment
There was a problem hiding this comment.
Please approve. This is great. Fixed my long-time frustrating issues with compose 1.7.0
would be very helpful to get this approved and added as a new version. Currently, I had to fork this and release my own version (do not want to do that...) - Please consider approving and saving other devs long frustrating hours...
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



After updating to Jetpack Compose 1.7, this library would lead to a crash (#65) in our app after typing about 7 or 8 digits (for a Canadian / US number, at least):
I suspect this occurs when a number starts to be formatted-as-you-type with parenthesis. E.g.:
416555would be formatted as416-555, while4165550would be formatted as(416)-555-0.I suspect that previous versions of Compose treated negative indexes passed to
transformedToOriginalas undefined behaviour, but in 1.7 it's more defined and leads to a crash.In any case, my colleague came up with a quick fix by clamping
-1to0. Not sure if this is the correct fix, but this has fixed the crash for us, and has had no negative outcomes in our code.While the fix was one line of code, it was necessary to increase the Jetpack Compose version to at least 1.7. However, in addition to updating Jetpack Compose to 1.7, we've also updated the library to use Kotlin 2.0; to use the Compose BOM (instead of defining individual libraries/versions); and updated some other dependencies.