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

Editor: Fixed Undo/Redo are both active when history is empty #28332

Merged
merged 1 commit into from
May 10, 2024

Conversation

ycw
Copy link
Contributor

@ycw ycw commented May 10, 2024

The issue: When editor starts and there's no history entries, Edit>Undo/Redo are both active (expected to be both inactive).

To reproduce:

  1. Go to https://raw.githack.com/mrdoob/three.js/dev/editor/index.html in incognito mode
  2. Hover Edit
  3. You should see Undo and Redo are both active.

The cause: Editor refreshes Edit>Undo/Redo on historyChanged, however, since there's no history, editor won't dispatch this siganl on start.

This PR fixed that by ... refreshing Edit>Undo/Redo once manually (not via signal) when editor starts.

Preview: (open in incognito mode) https://raw.githack.com/ycw/three.js/editor-init-undoRedo-on-start/editor/index.html

@ycw ycw marked this pull request as draft May 10, 2024 13:19
@ycw ycw marked this pull request as ready for review May 10, 2024 13:30
@Mugen87 Mugen87 added this to the r165 milestone May 10, 2024
@Mugen87 Mugen87 merged commit 4ec57f5 into mrdoob:dev May 10, 2024
11 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.

2 participants