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

Call the card input widget focus listener when focus is gained. #3520

Merged
merged 2 commits into from
Mar 25, 2021

Conversation

michelleb-stripe
Copy link
Contributor

@michelleb-stripe michelleb-stripe commented Mar 24, 2021

Summary

When the focus on postal code is entered the card input widget focus listener callback should be called. The CardInputListener.FocusField already included PostalCode as a field that could change, but the callback was never being called. Care was taken to make sure that this didn't impact the postal code validation on the field.

Motivation

Requested by a user of the card input widget.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Comment on lines +770 to +775
postalCodeEditText.internalFocusChangeListeners.add { _, hasFocus ->
if (hasFocus) {
scrollEnd()
cardInputListener?.onFocusChange(CardInputListener.FocusField.PostalCode)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be applied to CardMultilineWidget as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good news is that it is covered there already.

@michelleb-stripe michelleb-stripe merged commit 7dafc6d into master Mar 25, 2021
@michelleb-stripe michelleb-stripe deleted the michelleb/postal-code-focus-listener branch March 25, 2021 19:32
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.

None yet

2 participants