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 Todo List: Add 'Enter' Key Functionality for Task Addition and Editing #28

Closed
wants to merge 0 commits into from

Conversation

mudasirmurtaza
Copy link

This PR enhances the functionality of the Todo List application by adding support for triggering both task addition and task updates via the "Enter" key, improving the overall user experience. Previously, users had to manually click the "Add" or "Update" buttons to add or edit tasks. Now, pressing the "Enter" key while entering a task or editing an existing task will perform the corresponding action automatically.

Changes Made:

  • Enter Key Functionality:

    • Implemented key event listeners for the "Enter" key across the task input fields.
    • Users can now press "Enter" to:
      • Add a new task when not in edit mode.
      • Update an existing task when in edit mode.
  • Task Editing Workflow:

    • Added a flag (isEditing) to track whether the user is in "add" or "edit" mode.
    • Stored the index of the task being edited (editingIndex) to ensure the correct task is updated.
    • Automatically switch between "Add" and "Update" buttons based on the current mode (task addition or editing).
  • UX Enhancement:

    • The input fields are now more responsive, and task management is smoother.
    • Minor tweaks to the layout and styling were made for better consistency.

Issue Link:

Closes #18 – Add "Enter Key" Functionality to Trigger Task Submission

Additional Notes:

Please add the Hacktoberfest label to this PR as part of the Hacktoberfest initiative, so it can be counted towards contributions for participants.

Copy link
Contributor

@divanshu-go divanshu-go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mudasirmurtaza Thanks for the effort. Please tend to resolve the conflicts before we do final test and merge it

@mudasirmurtaza
Copy link
Author

@bryans-go , I have resolved the conflict and checked that the enter button is working well.

Also, one small question that, you will be adding the labels to the PR as well, right? The labels doesn't get attached automatically.

@Anshgrover23
Copy link
Collaborator

@mudasirmurtaza yes we are attaching it manually. when the PR work is done as hacktoberfest-accepted

@mudasirmurtaza
Copy link
Author

mudasirmurtaza commented Oct 12, 2024

@bryans-go, I have made a js change which is working fine, why I am not able to pass the checks? Can we merge this without passing checks ?

@Anshgrover23
Copy link
Collaborator

@mudasirmurtaza No, try to run npm run lint and npm run format to see why the checks are failing. If u need any help then ping me here only.

@divanshu-go
Copy link
Contributor

@mudasirmurtaza these are steps to follow in order to pass all the checks.
all the contributors should follow these else their PR will be closed

  1. go to your fork and click on sync fork and click Update Branch
  2. then go to the directory on your local machine
  3. Run git fetch origin
  4. Run git pull origin main
  5. Then resolve the conflicts if any.
  6. Then force push your branch by git push origin branch-name -f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "Enter Key" Functionality to Trigger Task Submission
3 participants