Tip Calculator App - Vite App

Solution retrospective
Hi, any advice you can give me to keep improving.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Mazz100
Hey. I just finished mine and would like to give a few suggestions.
-
Firstly just like @Dimitar mentioned you need to display an error text like it's in reference and I achieved that with conditional rendering.
-
For me I wanted to cap the digits because it makes no sense to insert hundreds of them so a simple
bill.length
can do the trick and then set it back to empty strings. -
Lastly if you want you could make a condition so the results doesn't render unless both bill and people are not 0.
Marked as helpful -
- @mitkokazakov
You should check if the number of people is 0 or less and display an error message above the input field. It could be done with oninput event which will be triggered every time when the user enter a number in the field.
Marked as helpful
Join 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