Skip to content

Fix "undo" incorrectly undoing text input#247

Merged
huchenlei merged 1 commit intoComfy-Org:mainfrom
webfiltered:fix-undo-text-input
Jul 28, 2024
Merged

Fix "undo" incorrectly undoing text input#247
huchenlei merged 1 commit intoComfy-Org:mainfrom
webfiltered:fix-undo-text-input

Conversation

@webfiltered
Copy link
Contributor

Originally submitted here: Comfy-Org/ComfyUI#4114

Fixes an issue where under certain conditions, the ComfyUI custom undo / redo functions would not run when intended to.

When trying to undo an action like deleting several nodes, instead the native browser undo runs - e.g. a textarea gets focus and the last typed text is undone. Clicking outside the textarea and hitting ctrl + z again just keeps doing the same thing.

This could use a slight refactor, but I went with "minimal changes".

Fixes an issue where under certain conditions, the ComfyUI custom undo / redo functions would not run when intended to.

When trying to undo an action like deleting several nodes, instead the native browser undo runs - e.g. a textarea gets focus and the last typed text is undone.  Clicking outside the textarea and hitting ctrl + z again just keeps doing the same thing.
@huchenlei
Copy link
Contributor

Do we know what these repro conditions are? If we can consistently reproduce it, we should add a playwright test on it.

@webfiltered
Copy link
Contributor Author

I really wanted to offer you something more concrete when creating the PR, but... I still don't actually know. I think it has something to do with holding a modifier key whilst focusing in/out of boxes. It felt like a concurrency bug, so I went searching for async in the undo code. Sorry!

@huchenlei
Copy link
Contributor

it's ok if we don't know. The change tracker file will eventually be removed anyway. Thanks for tracking this down!

@huchenlei huchenlei merged commit 3e3e909 into Comfy-Org:main Jul 28, 2024
@webfiltered webfiltered deleted the fix-undo-text-input branch July 28, 2024 15:02
benceruleanlu pushed a commit that referenced this pull request Aug 3, 2025
* Remove arbitrary 5 graph unit margin around nodes

* Remove arbitrary +1 pixel added to node width

---------

Co-authored-by: Chenlei Hu <huchenlei@proton.me>
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.

2 participants