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

Refactor/submit button disabling #30

Merged
merged 2 commits into from
Aug 1, 2021

Conversation

shayan-golafshani
Copy link
Collaborator

Created an intuitive error-handling that prevents users from submitting answers, unless the answer input is filled out. Additionally, I made the OnlyDevs, header a link, back to the home page. I primarily changed CSS to disable the cursor and then and make the button background red when disabled.

Description

I used hooks inside of onChange for the input, to set the state of the submission button. Then, I check for the length of the input field to make sure if users delete text, they still can't submit an empty answer to our database.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor

Motivation and Context

This change makes the UI more intuitive for the user and gently prods them to submit something in the answer form.
Before this, they were able to submit an empty answer, and that could overload our server, plus they were able to answer the same question many many times.

Concerns

  • Any bugs still present?
  • Potentially we may want to disable the red background from happening immediately upon submission, because it may confuse a user, about whether or not they successfully answered the question.
  • Next steps?
  • We may want to add state to the 'go to answers' button and make that button gold. That way the user can know they successfully submitted an answer and they will be prodded to go look at that page.

@shayan-golafshani shayan-golafshani added bug Something isn't working feature New feature or request component css refactor labels Aug 1, 2021
@shayan-golafshani shayan-golafshani self-assigned this Aug 1, 2021
@andrewvallejo andrewvallejo merged commit 8de1ee2 into main Aug 1, 2021
@andrewvallejo andrewvallejo mentioned this pull request Aug 1, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component css feature New feature or request refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants