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

text !== "" does not work and new ordered list element gets created when user starts typing blank space #3

Open
Abusayid693 opened this issue Aug 2, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Abusayid693
Copy link
Owner

Run the project in your local server and type more then 2 space you will see an ordered list gets created with initial value of 0.
The ordered list is suppose to get created only when user enter prefix of any numeric value So !isNaN(text) verifies that prefix entered by user is a numeric value but in case of blank space it also returns true (i.e isNaN(text) false ) stating that blank space is a numeric value of "0" which creates a ordered list.

if (!isNaN(text) && text !== "") ordered(elem, text);

@Abusayid693 Abusayid693 added the bug Something isn't working label Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant