upnotes-io / react-todo

A generic todo list componet for react. This is being used in an electron based app: https://upnotes.io
8 stars 41 forks source link

Undo shortcut #47

Closed AnasMansy closed 11 months ago

AnasMansy commented 1 year ago

for undo using "ctrl + z "

I've added support for undo using shortcuts implement undo functions.

kamalkishor1991 commented 1 year ago

@AnasMansy thanks for the pull request. Overall approach looks good to me. I tested it also and noticed that in this implementation undo is working at a item level. This is a problem for user as the whole item disapare on pressing undo but user might want to just undo the text in the text field. Please refer to keep for the behavior.

I think we should store full item state in the undo stack and priodically push state into the stack on change and update the whole state from the stack on pressing undo. We will have to also make sure that the stack history has max limit.

shahanahmed86 commented 11 months ago

@kamalkishor1991, I wonder if it's a duplicate one then should be closed. I think we have covered this functionality on this Pull Request