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 Fix: tab on MaskedInput for GeneratedItems it was clearing the value #12409
Conversation
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.
Nice work! And thanks for adding tests. One small docs change request
@@ -18,7 +18,7 @@ import layout from '../templates/components/form-field'; | |||
* ``` | |||
* | |||
* @param [onChange=null] {Func} - Called whenever a value on the model changes via the component. | |||
* @param [onKeyUp=null] {Func} - Called whenever cp-validations is being used and you need to validation on keyup. Send name of field and value of input. | |||
* @param [onKeyUp=null] {Func} - A function passed through into MaskedInput to handle validation. |
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.
This method is also called on the regular input, should that be called out here?
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.
Good point. I'll add that.
…lue (#12409) * fix tab issue * add test coverage * changelog * update documentation * remove meep: * documentation
…lue (hashicorp#12409) * fix tab issue * add test coverage * changelog * update documentation * remove meep: * documentation
Only in the case where the
MaskedInput
component was being called viaGeneratedItem
(e.g. auth methods with sensitive field inputs) the data was cleared on tab.This is because the
onKeyUp
function was not being handled in theMaskedInput
component but instead in theFormField
component. I moved this function down a level into theMaskedInput
. I tested all the other use cases ofMaskedInput
and things were working as expected.To replicate: