-
Notifications
You must be signed in to change notification settings - Fork 0
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
INPUT - Setting value of auro-input to undefined does not reset error state #118
Comments
@ethanwmiller thanks for your submission. Looking at this issue I can say a few things. The element's validation feature is triggered by If I am understanding the issue correctly, programmatically changing the value of the element is not triggering the Can you tell us more about the use case you have where there is an error on an element and you are programmatically removing the value of the input? A proposed solution that may work is, if you are programmatically targeting the element to clear the content, you can also target the |
@blackfalcon thanks for the response. Here is our use case in generic terms: when making a purchase, there is a "comments" input. By default, this input is not required. However, if a user adds a discount to their purchase, then the comments field is required. Finally, if the user removes the discount, then the comments field should be reset to its original state (blank and not required). So the very specific case where this comes up is thus: they apply a discount, they focus into the comments field, they blur away from the comments field (triggering the "field is required" error) and then they remove the discount. The expected behavior is that the error state goes away. But it persists. HOWEVER: your workaround works! Setting |
@ethanwmiller I see your use case to be very interesting. What I can also suggest is that as you toggle the https://auro.alaskaair.com/components/auro/input Supporting your use case directly may be difficult to do as it requires some heavy state management and we tend not to do that, but using the API as described enables you to do that. |
To be validated with Input's Beta Branch to see if this is still an issue. |
This "bug" is technically still valid as the experience can be replicated, but I am not sure if it should be classified as a bug. Currently, validation runs on change of input's value, validation is called manually or if certain attributes have changed. In this case, setting the value of an input to |
After talking with the team, we have determined that this is a valid bug that will be fixed as a part of our "Booking Forms" milestone. After further investigation, we have determined that the fix to this will be adding a function within |
The work to give the user the ability to reset the component to it's intial state will be addressed in this ticket: |
Please verify the version of auro-input you have installed
2.15.1
Please describe the bug
undefined
Reproducing the error on the docsite
This issue cannot be reproduced on the Auro docsite
Expected behavior
When the value of auro-input is set to undefined, it should completely reset the component, including error states.
What browsers are you seeing the problem on?
Chrome
Additional context
No response
The text was updated successfully, but these errors were encountered: