Closed KatieWoe closed 4 months ago
It seems the keypad is using accumulated values. I'm not sure why it wasn't doing this before, but I added a fix by clearing any accumulated keys whenever the eraser button is hit. Although it was easy I'm not sure this is the best way since it is exposing the keypad so I'd like a code review.
I provided two different patches. The first option just adds some documentation and then also checks the existence of this.keypad
instead of the option showKeypad
. This just feels a bit safer in case for some reason they are not aligned.
The second option does the same without converting keypad into a class property that way you don't have to expose it. I think the second option might be preferable so that we don't create a class property if we don't need to, but I would be okay with the first option as well. Whatever you feel is best.
Option 1:
Option 2:
back to you @Luisav1
Thanks @marlitas! I'll go with option 2 since I also like that it's not a class property anymore and only assigned when necessary.
This is now fixed as seen below.
https://github.com/phetsims/arithmetic/assets/52978048/5e886dd4-bf86-453a-97a9-089f57e3b6c1
Closing.
Test device Dell Operating System Win 11 Browser Chrome Problem description For https://github.com/phetsims/qa/issues/1046 If you press the erase button on a screen, any number you were previously entering will appear gone, but when you try to enter a new number, it will reappear and continue adding numbers at the end. If the number was three digits, nothing will appear until you press backspace. This occurs both with keyboard and number pad entry. This is not in published. Steps to reproduce
Visuals![baderaser](https://github.com/phetsims/arithmetic/assets/41024075/71794241-6623-44b8-a214-6755629413e4)
Troubleshooting information: