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
New JavaScript Projects tests can fail if code depends on change event of input field #53390
Comments
I am kinda of leaning towards this option. Let's see what the others think |
Yes, I agree - let's go that route. |
Hi @gikf, When you say
Do you mean to add to all the coding challenges similar to the palindrome checker? Or just the palindrome checker? |
One last question @gikf |
@Deep512, English only, other languages will be later updated using translation workflow. |
@gikf @jdwilkin4 @naomi-lgbt Have raised a PR for this issue, please review |
We realize you're looking to get help as soon as possible. Rather than pinging someone directly, which can be considered rude, would you mind joining our Discord and asking your question there? Someone might be more readily available to help. |
I'm new to this and would be waiting to see what others say and learn along the way |
Describe the bug
A bit of mouthful. Most of the tests in new projects are directly setting the
value
of input field. This can create unexpected troubles if camper's code depend on theonchange
of the said input field.For example camper added
onchange
to the input field (inputField
). Function was updating globalvalue
, which was later used by the function when the action button was clicked. BecauseinputField.value = 'something'
is not triggeringonchange
on theinputField
, thevalue
was empty, and results failed.While all worked well when checked by hand.
There's couple options:
onchange
on the input field. For exampleinputField.dispatchEvent(new Keyboard('keyup', {key: 'ArrowRight'}))
should work.Additional context
https://forum.freecodecamp.org/t/problem-with-palindrome-checker/667410
The text was updated successfully, but these errors were encountered: