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
[BUG] CardInputWidget does not restore state properly with Compose #7788
Comments
Hi @dabluck 👋 Thanks for reporting this and double-thanks for providing a sample for reproducing the issue 🙏 We’ll have a look into that issue and let you know what we find. |
Just adding I am passing for the same issue. After a navigation event in a Compose application, backing to the screen where I have placed the |
Internal ref: https://jira.corp.stripe.com/browse/RUN_MOBILESDK-2878 You can avoid this state restoration issue by creating the
|
Please reopen if you still have issues. |
@jaynewstrom-stripe That is a workaround for some cases but it's not a solution. The state restoration is broken. If for example the activity was torn down and recreated, creating it once is not possible. |
+1 to @dabluck's comment, unfortunately the suggested workaround isn't a viable long-term solution. Would really appreciate a fix for this, since it makes the widget unusable for our users 🙏 |
@jaynewstrom-stripe , I tried the workaround you said, it did not work for me 😢 Do you have any other suggestion? Ty in advance 🙏🏼 |
Summary
When #onRestoreState runs, the CardInputWidget breaks and nothing can be entered. Specifically I believe the internal
cardNumberTextInputLayout
has a width of 0 and therefore nothing can be entered. This is happening with jetpack compose although I'm not sure state restoration would be different without composeCode to reproduce
Sample Repo
Specific Code
Android version
Observed on Android 12 and Android 14 emulators but seems to be universal
Installation method
Gradle
Dependency Versions
kotlin: 1.9.0
stripe-android: 20.36.1
Android Gradle Plugin: 8.2.1
Gradle: 8.2
SDK classes
CardInputWidget
Video
stripe.webm
The text was updated successfully, but these errors were encountered: