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

isFocused property not getting updated on inputs of type "zip-code" #37

Open
ali-ebner opened this issue Apr 11, 2022 · 2 comments
Open

Comments

@ali-ebner
Copy link

Expected Behavior

The isFocused property in the form state should get updated on focus and blur for vgs form fields of type zip-code

Current Behavior

isFocused does not get updated for zip-code inputs

Steps to Reproduce (for bugs)

Code pen example:
https://codepen.io/ali_ebner/pen/NWXBvjM?editors=1111

  1. Put your cursor into the zip code field or start typing into this field
  2. Check the output of the card-zip form state in the console. See that isFocused remains false even though other fields update
  3. Remove focus from the zip code field
  4. See that other form fields update but isFocused remains false/unchanged

Context

Styles and other behaviors that are dependent on the isFocused state for this field are not applying.
Current workaround is to use field.on('focus') and field.on('blur') and then update React state to keep track of focus for this field.

Your Environment

  • Version used: 2.12.0
  • Browser Name and version: Chrome 99.0.4844.74
  • Operating System and version (desktop or mobile): macOS Big Sur 11.6
@AnnaKudriasheva
Copy link
Collaborator

Thank you @ali-ebner for pointing this out! We're working on the fix.

@AnnaKudriasheva
Copy link
Collaborator

@ali-ebner we've fixed it in the scope of the VGS Collect.js 2.13.0 version. Please try it out and let us know if the issue with the focused state still appears. Thanks!

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

No branches or pull requests

2 participants