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

Restricted negative values/sign in weight and height user input #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rakheesingh
Copy link

This PR address is my proposal of bug #44 Negative weight and height should not allow in user input.
I have added a function called filter input to validate user input on the event of keyDown.

const filterInput = (e, restrictKeyList) => {
		let isValidInput = restrictKeyList.some((key) => e.key === key);
		if (isValidInput) e.preventDefault();
	}

This small change will restrict users to enter any sign in input and solve issue #44.

@codecov
Copy link

codecov bot commented Nov 27, 2021

Codecov Report

Merging #48 (43214fe) into master (7e4714d) will decrease coverage by 0.99%.
The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   53.62%   52.63%   -1.00%     
==========================================
  Files           5        5              
  Lines          69       76       +7     
  Branches        5        6       +1     
==========================================
+ Hits           37       40       +3     
- Misses         29       33       +4     
  Partials        3        3              
Impacted Files Coverage Δ
src/components/BmiForm/BmiForm.jsx 72.72% <42.85%> (-13.94%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e4714d...43214fe. Read the comment docs.

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