I'm making a calculator app for class and I have run into a snag while implementing keyboard listeners. Everything on the keyboard side works properly, but I have found that when I am forced to physically click on a button, such as the more obscure functions which don't have keyboard keys, the button is staying focused. This normally wouldn't be an issue, except that every time I press the 'enter' key to solve the inputted function, the calculator thinks I'm pressing that focused button.
CSS hasn't worked and I can't find anything on Google for how to deactivate this. If it matters, I am using Bootstrap 3 for this. We haven't covered JQuery yet, so I'm hoping for a pure JS way to solve this if it's possible.
Thanks!
Thank you all for the responses. I tried both and my issue was solved, however it took either an extra function or an extra listener. I ended up finding the blur() function and calling it at the end of my switch statement which controls clicks accomplished what I wanted. Thank you again though!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With