cal.com
cal.com copied to clipboard
Make undo (ctrl+z) work in the Editor component
Is your proposal related to a problem?
It would be great if the user can use the undo option while typing something. This option is missing in the Editor (@calcom\ui\components\editor) component. The editor component is used for writing the description or agenda for a new meeting and in the About section of the user's profile
- https://app.cal.com/event-types?dialog=new&event
- https://app.cal.com/settings/my-account/profile
Current behavior:
https://user-images.githubusercontent.com/47350983/235458247-2250b14c-339a-4dab-aa06-f74c3870c1b4.mp4
Describe the solution you'd like
The lexical react package comes with a History Plugin which enables the undo/redo option.
Expected behavior (with the History plugin added):
https://user-images.githubusercontent.com/47350983/235457839-709f43d1-540e-4237-b74f-417593ccd93d.mp4
Can I work on this?
@Praneeth2k I would like to help!
@ameeetgaikwad I wanted to work on this, have the PR up. Sorry, but here's something I learnt that might be useful to you for your future PRs.
There are ESLint errors in the PR you raised. This can be fixed by running:
npx eslint <path-to-file> --fix
to fix the file you've edited or npx eslint . --fix
to fix all the files.
The issue is that your editor might change LF to CRLF and this doesn't show up in in git diff.
@Praneeth2k sorry. Didn't see that you made a PR too.
@Praneeth2k i tried the eslint thing, but gave me error. Trying to do the same thing in a different branch let's see if it works or not