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

fix: undo/redo when exiting view mode #8024

Merged
merged 2 commits into from
May 19, 2024

Conversation

Vatsalsoni13
Copy link
Contributor

Description

This PR addresses the bug: When exiting view mode the undo/redo buttons are disabled even though their stacks aren't empty.

Fix

Fixes #7948.
The default constructor is getting called which has values isUndoStackEmpty equal to true and isRedoStackEmpty equal to true.
Passing the function(from class History) which checks for whether the stacks are empty or not fixes the issue.

Comparison

Before

before.mp4

After

after.mp4

Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview May 19, 2024 1:07pm
excalidraw-package-example ✅ Ready (Inspect) Visit Preview May 19, 2024 1:07pm
excalidraw-package-example-with-nextjs ✅ Ready (Inspect) Visit Preview May 19, 2024 1:07pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview May 19, 2024 1:07pm

@Vatsalsoni13
Copy link
Contributor Author

Vatsalsoni13 commented May 17, 2024

Hello,
I tried rerunning the test files on my local machine but I don't seem to get the error which is shown above. It would be very helpful if someone could explain what exactly is the testcase testing. I tried searching for documentation related to tests in the repo but couldn't find it.
Thank you.
(I'm new to open-source apologies if it is trivial)
Edit:
Checks have been passed

@dwelle
Copy link
Member

dwelle commented May 19, 2024

I tried rerunning the test files on my local machine but I don't seem to get the error which is shown above. It would be very helpful if someone could explain what exactly is the testcase testing. I tried searching for documentation related to tests in the repo but couldn't find it.

Yeah, we have some flaky tests in the history test suite, we'll need to fix.

Anyway, I added tests for this PR. We're good to go. Thanks!

@dwelle dwelle merged commit afe52c8 into excalidraw:master May 19, 2024
8 of 9 checks passed
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.

Exiting view mode does not re-render undo/redo buttons
2 participants