Codelabz
Codelabz copied to clipboard
FIXED THE LOWER VALUE OF COUNT UPON CLICKING OF TOGGLE DOWN ARROW BUTTON
Description
This PR fixes the issue of value going below zero ( i.e negative value) on pressing the toggling down button. Now the value don't go below zero even if you click on the down button once the value is reached to zero.
What I did is I first of all make changes in the handleDecrement function which decrease the value of count upon clicking of toggle down arrow button. And then make sure to render the count as it is changing according to the only if the count is greater than zero else in the default case, it's value is zero.
##Related Issue This PR fixes the issue #953.
Motivation and Context
A negative value indicating for any thing which can't be negative is not good for user experience
Screenshots or GIF (In case of UI changes):
Screencast from 23-01-24 03:06:46 AM IST.webm
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.