-
Notifications
You must be signed in to change notification settings - Fork 263
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
[Android] fix: card field focus jumps back to the card number field #630
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
06e48d4
fix: card field focus jumping back to the card numbr field
arekkubaczkowski 68fe413
chore: re-run tests
arekkubaczkowski ab53a4b
chore: set profile
arekkubaczkowski 59f6374
chore: revert
arekkubaczkowski ceb6600
chore: set galaxy nexus as a profile
arekkubaczkowski 87b23ef
Update example/index.js
charliecruzan-stripe 1231fc6
[skip actions] Update android/src/main/java/com/reactnativestripesdk/…
charliecruzan-stripe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this else case where it is not vali do you still need to sendCardDetailsEvent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michelleb-stripe yes and I do this, you can find the calls in the particulars text fields listeners
stripe-react-native/android/src/main/java/com/reactnativestripesdk/StripeSdkCardView.kt
Line 238 in 06e48d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would mean that the CardValidCallback would always need to be followed by a TextWatcher. I am not sure this is a guarantee we can make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelleb-stripe I'm taking this over from Arek but I'm not sure I get this properly. Can you please help me understanding the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@souhe Let me try to explain more. The setExpiryDateTextWatcher and setPostalCodeTextWatchedr called onCardChanged, which will get the paymentMethodCreateParams without first checking to see if they are valid. Because of how a query on the paymentMethodCreateParams works it will change the focus on the widget, to the first field that is invalid.
paymentMethodCreateParams should only be called from the CardValidCallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michelleb-stripe I'm afraid I'm still confused :D Are you describing your previous comment or this whole issues?
If the first one then I'm not getting why calling
sendCardDetailsEvent
fromsetExpiryDateTextWatcher
orsetPostalCodeTextWatcher
would callpaymentMethodCreateParams
.If the second one I'm still not sure what this means -
I think that would mean that the CardValidCallback would always need to be followed by a TextWatcher. I am not sure this is a guarantee we can make
. Why is that true? If I understand the code created by Arek properly we are sendingsendCardDetailsEvent
on every change from each watcher so that is why there is no need to send this even once again from cardValidCallback (when card is invalid)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. Looking at it again it looks good to me.