feat(task): cancel editing task title with escape #2730
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "DanielPantle/vikunja:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
I am not very experienced with vue and this is my first PR, so please be kind ;)
Summary
With this change, it is possible to cancel editing the task title with pressing the escape key
Problem
Before it was not possible to cancel editing the task title. Pressing outside the title saves the changes that have already been done (which is intended I think). But when e.g. pasting something with a wrong format, I was not able to revert the change without saving and editing it again
Example: after accidentially pasting something with multiple lines it is not possible to escape, the only way to revert this is to save and edit again manually:

Solution
This PR implements a listener for the escape key that sets the title back to its original value and blurs the focus of the title
Additional notes
Hi DanielPantle!
Thank you for creating a PR!
I've deployed the frontend changes of this PR on a preview environment under this URL: https://2730-main--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/.
This preview does not contain any changes made to the api, only the frontend.
Have a nice day!
@ -30,6 +30,7 @@
:spellcheck="false"
@blur="save(($event.target as HTMLInputElement).textContent as string)"
@keydown.enter.prevent.stop="($event.target as HTMLInputElement).blur()"
@keydown.esc.prevent.stop="($event.target as HTMLInputElement).textContent = task.title; ($event.target as HTMLInputElement).blur()"
Can you move this into its own function?
Yes, sure. Done
Welcome!
The closing via esc is something that should work eventually, but we'll deal with the restore functionality when we have that.
Looks good! The ci failure is probably related to today being the first of October, will re run it tomorrow.
feat(frontend): cancel editing task title with escapeto feat(task): cancel editing task title with escapeThanks again!