jump-sdk / jetpack_compose_country_code_picker_emoji

Jetpack Compose Country Code Picker with Emoji Flags
https://jitpack.io/#jump-sdk/jetpack_compose_country_code_picker_emoji
Apache License 2.0
51 stars 18 forks source link

Temporary fix for crash in focus requester code #43

Closed ankur2136 closed 1 year ago

ankur2136 commented 1 year ago

42

There are some non-answers to this issue so far. https://stackoverflow.com/a/77250333 Looks like a platform issue to me.

hbmartin commented 1 year ago

What about wrapping it in try/catch ? That way we can usually get the correct behavior but avoid the crash

ankur2136 commented 1 year ago

What about wrapping it in try/catch ? That way we can usually get the correct behavior but avoid the crash

I would say both are hacky solutions till we understand why exactly does this path crash in the second instance. Happy to make the change with try/catch

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

hbmartin commented 1 year ago

My guess it has something to do with the final point in the error you posted in the issue 3. Are you attempting to request focus during composition? Focus requests should be made in response to some event. Eg Modifier.clickable { focusRequester.requestFocus() } ... which seems entirely contrary to how we want to use it?

I think @tanany365 was thinking about similar issues in that PR https://github.com/jump-sdk/jetpack_compose_country_code_picker_emoji/pull/35

hbmartin commented 1 year ago

@omarsanchezv fyi