-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix(tag): update state to clear form on success #25934
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.
@hughhhh would you mind adding some testing instructions and unit tests (if possible). I've also added @justinpark as a reviewer as it seems unclear why we need to clear the form, i.e., this seems like an atypical pattern.
Added test instructions, but the problem is when users are creating a Tag and save the form. The values are kept on the next instantiation of the modal, when they should it should be cleared for new data. |
@justinpark would you mind reviewing this as I'm somewhat naive when it comes to frontend. |
SUMMARY
Currently the state in the tags form isn't being cleared. So the values from a previous entry are staying whenever a user wants to create a new tag. To fix this I refactored the component to have a
clearForm
function that will clear the state in the component whenever called.Screen.Recording.2023-11-09.at.10.06.06.AM.mov
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
+ Tag
form should be emptyADDITIONAL INFORMATION