Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Calculator Functionality: Implement "=" on "Enter" Key Press #48

Closed
K-RD opened this issue Oct 24, 2023 · 3 comments
Closed

Enhance Calculator Functionality: Implement "=" on "Enter" Key Press #48

K-RD opened this issue Oct 24, 2023 · 3 comments

Comments

@K-RD
Copy link

K-RD commented Oct 24, 2023

Issue Summary:

I would like to propose an enhancement to the existing calculator functionality on the project. Currently, the calculator performs calculations when the "=" button is clicked. However, it would be user-friendly to also allow the calculation to be executed when the "Enter" or "Return" key on the keyboard is pressed.

Expected Behavior:

When a user enters an equation and presses the "Enter" or "Return" key on their keyboard, the calculator should perform the calculation, mimicking the functionality of clicking the "=" button.

Steps to Reproduce:

  1. Open the calculator on the project.
  2. Enter a mathematical expression (e.g., 2 + 2) into the input field.
  3. Press the "Enter" or "Return" key on the keyboard.

Current Behavior:

At present, pressing the "Enter" or "Return" key does not trigger the calculation. Users are required to click the "=" button manually.

Suggested Implementation:

To implement this feature, you can use JavaScript to listen for the "Enter" or "Return" key press event when the calculator input field is in focus. When the key is pressed, execute the calculation process as if the "=" button was clicked.

@Ctoic
Copy link
Owner

Ctoic commented Oct 24, 2023

Ok Great @K-RD if you want to add this functionality I will assign the issue to you. Let me know

@K-RD
Copy link
Author

K-RD commented Oct 24, 2023

@Ctoic Please assign me this issue and add the necessary tags.

@K-RD
Copy link
Author

K-RD commented Oct 25, 2023

As per the advancement in the project, I don't think there is any need to implement this functionality. Please do let me know your opinions, then will close this issue after discussion.

@Ctoic Ctoic closed this as completed Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants