-
Notifications
You must be signed in to change notification settings - Fork 665
Fix: Prevent consecutive operator input in CalculatorModal #3359
Fix: Prevent consecutive operator input in CalculatorModal #3359
Conversation
Resolved an issue in the CalculatorModal where consecutive operators could be added, resulting in invalid expressions. - Updated the handleOperator function to ensure only one operator is added at a time. - Replaced the last operator if a new operator is pressed. - Ensured the input behaves like a standard calculator. This change improves the user experience by preventing invalid expressions and aligning the calculator's behavior with user expectations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Left some minor comments to resolve. Does it work for entering "-10"? Lots of people use it for adding negative balances
temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/edit/CalculatorModal.kt
Outdated
Show resolved
Hide resolved
temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/edit/CalculatorModal.kt
Show resolved
Hide resolved
I dont get it ....... |
Can you input the following expression when adjusting balance?
|
neg.mp4If you mean this then yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Fix the CI and we can merge
It's ready to merge |
@akashs056 you missed to add which is closed by this PR and now I have to manually go and close it. Not a big deal but so you know for future PRs |
Pull request (PR) checklist
Please check if your pull request fulfills the following requirements:
What's changed?
Resolved an issue in the CalculatorModal where consecutive operators could be added, resulting in invalid expressions.
This change improves the user experience by preventing invalid expressions and aligning the calculator's behavior with user expectations.
Before
https://github.com/user-attachments/assets/c4cb087d-e360-44b1-90fd-38f3436e5e04
After:
https://github.com/user-attachments/assets/085816dc-9ad7-459a-b48e-c35e3bd649ad