Closed tatems closed 2 years ago
cc @Ryguy11
hey @tatems
this issue is caused by: it's not possible to focus a disabled input. this is true for plain HTML/DOM, so it's not a pininput-specific issue.
the reason the problem exists for pininputs is that the example given in the styleguide for the mocked api call is because it attempts to focus the internal input before it's been un-disabled, this invalid sequencing can be fixed in a couple ways:
disable
MPinInput while you're asynchronously validating the code orI update the PinInput docs in this PR to show how 2 can be done. You can verify that the fix fixes the issue in this styleguide deploy. If that PR fixes your issue please approve it. I'll merge it in and close this issue. Otherwise, please let me know how/why the fix doesn't apply to your situation and I'll work on an alternative fix.
I'm gonna assume this merged PR with updated PinInput docs has fixed the issue, but if you have any additional questions or concerns feel free to re-open this issue.
Bug description
When clearing/shaking a pin input that was previously disabled, the pin focus is not updated correctly.
eg ->
Reproduction
This is currently reproducible on the docs site with the async input
https://user-images.githubusercontent.com/3402466/158885078-1b37eec3-b94c-4744-980c-56955da69a8b.mov
Environment
Addressed by
No response
Can you contribute a fix?