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

Clears input field. #22

Merged

Conversation

DeadlockDruid
Copy link
Contributor

It clears the minutes' input field after a successful HTTP request.

#19 Fixes.

It clears the minutes' input field after a successful HTTP request.
@vercel
Copy link

vercel bot commented Jan 18, 2022

Someone is attempting to deploy a commit to a Personal Account owned by @ats1999 on Vercel.

@ats1999 first needs to authorize it.

@DeadlockDruid
Copy link
Contributor Author

@ats1999 Please review and let me know if any changes are required, thanks!

@ats1999 ats1999 self-requested a review January 20, 2022 13:53
@@ -29,6 +30,8 @@ export default function BackDate() {
})
.then((res) => {
alert("Updated successfully");
minutesInputRef.current.value = '';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check, current.value should be a number or string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ats1999 If I set current.value to a number then it will show that number instead of a blank field, so used ''.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great man

@@ -29,6 +30,8 @@ export default function BackDate() {
})
.then((res) => {
alert("Updated successfully");
minutesInputRef.current.value = '';
setTime('');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that time value can be a string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ats1999 to set the current field as empty I set the value to be the empty string. It also disables the submit button when the value is empty string enforcing the user to set any other value to submit the form.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okey, i am approving the changes.

Thanks for contribution

@ats1999 ats1999 merged commit 96d3bd8 into ats1999:main Jan 20, 2022
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

Successfully merging this pull request may close these issues.

2 participants