Design comparison
Solution retrospective
I might try React for a similar project next time, as the useState hook would probably help a lot. Even tho here are some bugs and improvements needed, as well as some repeated code but proud to finished it.
Community feedback
- @NikitaVologdinPosted about 1 month ago
Hi @KapteynUniverse! I was also considering a React approach for this challenge. It seems like it would be more efficient. After reviewing your feedback, I understand that you've identified some bugs in your app, and I'm confident you'll address them. Great work on completing the challenge!
I appreciate how your app responds dynamically to each input. While I'm curious about your choice to use a "keyup" listener, I suggest considering a "change" listener for a more responsive experience. Your focus on reactivity aligns with my approach, and I'll likely incorporate similar techniques.
Finally, if I were in your position, I'd explore removing the step attribute from the input elements.
Best, Nikita.
1@KapteynUniversePosted about 1 month ago@NikitaVologdin Hey Nikita. Thanks for the feedback, i made a few changes on local files.
You are right, step is not necessery or at least the value shouldn't be 0.01 here, default value 1 is enough, i changed min value to 1 too also on bill input.
One of the bug is you need to put inputs in order. It doesn't work if you set people then bill and then chose tip. This is why i considered react.
Other one is increase and decrease arrows on the inputs wasn't working, your "change" suggestion made them work but this time you need to click somewhere on the page to process last input. So i used both keyup and change listener.
Lastly i added event listener to the form instead of each button.
form.addEventListener("keyup",handleInput) form.addEventListener("change",handleInput)
then :D i looked here and found input listener. It works alone as both change and keyup
form.addEventListener("input",handleInput)
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord